I need a space between commas in a comma delimited file

Pat Shugart pshugart@rust.net
Tue, 19 Oct 1999 14:16:39 -0400


Mark,

Try using the TRUNC function on the initial defines, then 
concatenate them all together on the DATALINE definition.

For example: 
define x char*10 = trunc(whatever) + "," if some-field <> "" else " ,"
define y........

define DATALINE char*100 = x + y + z + ...

HTH, 

Pat Shugart
Oaksoft Consulting, Inc.


Sometime around 12:30 on 19 Oct 99, mmorgan@accubanc.com wrote:

> VAX/VMS    POWERHOUSE 710G1
> 
> Hello,
> 
> I?m trying to put a single space in a comma delimited file when a
> field IS blank (Don?t ask me why, I just have to do it).  The problem,
> is that there can?t be any leading or trailing spaces when the field
> is NOT blank.
> 
> I have to truncate and pack to get rid of the leading/trailing spaces,
> but I don?t want to trunc/pack if the field is blank.
> 
> Lets say SOME_FIELD = "BOB" and OTHER_FIELD IS BLANK
> 
> DEFINE X CHAR*10 = SOME_FIELD IF SOME_FIELD NE "" ELSE " "
> DEFINE Y CHAR*10 = OTHER_FIELD IF OTHER_FIELD NE "" ELSE " "
> 
> DEFINE DATALINE CHAR*100 = &
> TRUNC(PACK(X + "," + Y + ","))
> 
> REPORT DATALINE
> 
> This would produce an output file that looks like this
> 
> BOB,,
> 
> What I want it to look like is this
> 
> BOB, ,
> 
> 
> I Have about 75 fields to deal with so if anyone can help, I sure
> would appreciate it.
> 
> Thanks,
> Mark

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.