01-23-2013 06:56 PM
Hey all! Thank you in advance for reading and thank you doubly should you try and assist.
So I am trying to export a CSV file with no header row, ~ as the delimiter, and a | character (I think this the pipe character) as the record delimiter.
So I have this wrapped up in a macro:
FILENAME dlmTest &fileName lrecl=50000;
PUT (_ALL_) (+0);
I found, as part of the FILE syntax, RECFM but I'm running into a series of problems.
The file always automatically inserts the CRLF when generating unless I have RECFM=N
(the option for fixed length won't work, since my fields are variable length).
When I use RECFM=N, it would almost work except it adds an additional ~ after each line.
As part of my data set, I found I could add a column that just put in the pipe I needed as I didn't see an obvious way to add this in normally.
My question ultimately is how to generate, for multiple records, a single line of output for a CSV without CRLF automatically added and without adding the extra ~ to the end of the record.
Thanks for any help you can provide!
01-24-2013 12:29 PM
In order to put (_ALL_) in parenthesis, in order to switch its meaning from "put program data vector" to "variable list" we need to follow with the parenthesized list of (format specifications/pointer control). The OP used +0 for the same reason but for some unknown reason I don't like +0.
I can't be nothing.
01-24-2013 01:01 PM
To arrive at an understanding of the syntax of what data _null_; originally supplied, I utilized the following two documents:
I was looking in the wrong place for what I was trying to do, trying to manipulate the file instead of what was actually being put into the file - that was my mistake.
Now I am much more enlightened to the extent and power of the PUT statement thanks to DN and this wonderful documentation.
Need further help from the community? Please ask a new question.