Hi Dear,
I am writting a SAS dataset to a file. Accourding to my coding , it doesn't write the 2nd and continues records properly in the output file. when I put recfm=v, it does write properly on file. Can any one tell the reason for this. or Am I doing right if put recfm=v?
LIBNAME SWXTEST 'C:\mylib\MAY2011';
FILENAME SWXTEST1 'C:\v_sas_mytest.txt' ;
DATA _NULL_;
file swxtest1 LRECL=4046 RECFM=F ;
set swxtest.v_sas_temp(obs=100);
PUT @ 1 APPID 8.
@ 9 APPTITLE $100.
@ 109 ORIGINBRANCHID $6.
@ 115 ORIGINOFFICERID $1.
@ 116 PRIBORTYPE $1.
@ 117 PRIBORID 8.
@ 125 INSTANTRESP $1.
@ 126 DATEAPPENTRYSTART datetime20.
@ 146 PERSONNELID 8.
@ 154 APPLICATIONSOURCE $20.
@ 174 FRSTNAM $15.
@ 189 LSTNAME $25.
@ 214 EMPLOYNUM 8.
@ 222 ATTACHREQ $3.
@ 225 APPLICATIONTYPE $4000.
@ 4225 SWXVAILABLEREVOLVINGCREDIT 10.2
@ 4235 SWXRETURNEDTOBRANCH $1.
@ 4236 SWXTOTALCREDITSTOCONNECTIONS 10.2
@ 4246 SWXCONNECTEDBUSINESSCREDIT 10.2 ;
run;
Thanks very much in advance
Antony
If you are expecting 100 records with CR/LFs at the end of each record, remove the recfm= option. I.e., use:
file swxtest1 LRECL=4057;
First a question: what does it do when you specify an lrecl that is as large as the record you are trying to write?
You specify 4046 but then try to write a record that is at least 4255 characters wide.
Thanks Arthur.
It is my typo. I tried with 4255 with the record lenght as well and put the recfm=f. but the problem is it is writting the second record very far. It is not write 2nd record at the 4256 column. or row after 4256 column.
thanks
Anton
If you are expecting 100 records with CR/LFs at the end of each record, remove the recfm= option. I.e., use:
file swxtest1 LRECL=4057;
Thanks very much Arthur. It resolved my problem.
Antony
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.