Date: Tue, 25 May 2004 14:51:58 -0400
Reply-To: Peter Crawford2 <peter.crawford@BLUEYONDER.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Peter Crawford2 <peter.crawford@BLUEYONDER.CO.UK>
Subject: Re: Making external file with the same length as the original SAS
You might be getting overflow lines for every row !
That could increase your file size ( lines, but not max line width).
When generating a pipe delimited file, you might want to use
instead of this style of coding, the filename statement DSD option
and request pipe delimiters, like
retain <list in order, the variables you want in your output file> ;
file 'file1.txt' DSD DLM= '|' lrecl=10000 ;
put ( <firstVariableWanted> -- <lastVariableWanted> )( : ) ;
The DSD option places a delimiter between each variable. The
default is comma, but the dlm= option allows pipemark (|) to
Additionally, the DSD option protects and delimiter embedded in
data, by quoting the value on the output file. This is the standard
for such situations. In support of that standard, there is a
similar rule to protect any quotes that occur in data.
Of course, since what you are generating with the code below is
very standard, there is a sas procedure to support it. Have a
look at the online-doc for proc export
Crawford Software Consultancy Limited
On Tue, 25 May 2004 12:42:04 -0500, Duck-Hye Yang <dyang@CHAPINHALL.ORG>
>I wanted to make an external file. I tried to use the following code.
>file 'file1.txt' ;
>SURVEYID '|' COUNTY '|' ORG_NAME '|' PHONE '|' ADDRESS '|' CITY '|'
>ZIP '|' FAX '|' URL '|' RSPNDNT '|' R_PHONE '|' R_TTY '|' R_EMAIL '|'
>there are alot more variables.
>My problem is that the record length of the newly created file
(file1.txt) increased from 1,011 (of the original file) to 2,022.
>How can I get the file that contains the same number of records as the