LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 1999, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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


Back to: Top of message | Previous page | Main SAS-L page