I need a space between commas in a comma delimited file
mmorgan@accubanc.com
mmorgan@accubanc.com
Tue, 19 Oct 1999 12:30:23 -0500
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.