Date: Fri, 27 Aug 1999 11:01:21 -0400
Reply-To: Brian Mitchell <brian@ABOVEAVERAGECONSULTING.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Brian Mitchell <brian@ABOVEAVERAGECONSULTING.COM>
Subject: File Writing via SCL
Content-Type: text/plain; charset="iso-8859-1"
I'd like to produce a file under WINSAS 6.12
that can be %included . My first attempt works
fine except that all of the "lines" are written
to a single line in the output file. That's bad
because of the 200 character limit. Any suggestions
on how to achieve LF/CR? Do you have to insert hex
codes or is there a simple function/option I've
overlooked? TIA.
Here's my code snippet:
file reference - filename zipcode 'c:\temp\zipcode.txt' lrecl=16 recfm=f ;
SCL -
fileid = fopen( 'zipcode', 'O') ;
call notify('XENTRY', '_GET_VALUE_', listid) ;
nrows = listlen( listid) ;
rc = FPOS( fileid, 1) ;
ziprange = 'proc format ;' ;
rc = FPUT( fileid, ziprange) ;
rc = FWRITE( fileid) ;
rc = FPOS( fileid, 1) ;
ziprange = 'invalue ziprange' ;
rc = FPUT( fileid, ziprange) ;
rc = FAPPEND( fileid) ;
do i = 1 to nrows ;
rc = FPOS( fileid, 1) ;
ziprange = getitemc( listid, i)||' = 1';
rc = FPUT( fileid, ziprange) ;
rc = FAPPEND( fileid) ;
end ;
rc = FPOS( fileid, 1) ;
ziprange = 'Other = 0 ;' ;
rc = FPUT( fileid, ziprange) ;
rc = FAPPEND( fileid) ;
rc = FPOS( fileid, 1) ;
ziprange = 'run ;' ;
rc = FPUT( fileid, ziprange) ;
rc = FAPPEND( fileid) ;
rc = FCLOSE( fileid) ;
Brian Mitchell
Above Average Consulting, Inc.
brian@aboveaverageconsulting.com
(614) 901-9053 Fax (614) 901-9054
|