I am using proc export to export a file to csv format with several thousand variables, and SAS writes more than 5,000 lines to the log file, which is a nuisance. Can that be suppressed somehow? I tried "nosource" but that has no effect. It is SAS 9.4. If you don't believe me, here is an extract from the middle of a file with 74 variables:
505 ',' 506 "taxbc" 507 ',' 508 "s006" 509 ; 510 end; 511 set _LAST_ end=EFIEOD; 512 format MARS best12. ; 513 format XTOT best12. ; 514 format EIC best12. ; 515 format f6251 best12. ;
It goes on for 315 lines for this small file. It looks like this output was intended for debugging problem exports. Surely there is a way to turn it off.
Daniel Feenberg
use SAS log controls like nonotes and such.
here is a link to assist you with those SAS options that control your logging.
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000279162.htm
Option nonotes;
That’s one option, turn it on again after the export using the NOTES option.
PROC PRINTTO is another as it redirects your log to an external file.
@feenberg wrote:
I am using proc export to export a file to csv format with several thousand variables, and SAS writes more than 5,000 lines to the log file, which is a nuisance. Can that be suppressed somehow? I tried "nosource" but that has no effect. It is SAS 9.4. If you don't believe me, here is an extract from the middle of a file with 74 variables:
505 ',' 506 "taxbc" 507 ',' 508 "s006" 509 ; 510 end; 511 set _LAST_ end=EFIEOD; 512 format MARS best12. ; 513 format XTOT best12. ; 514 format EIC best12. ; 515 format f6251 best12. ;It goes on for 315 lines for this small file. It looks like this output was intended for debugging problem exports. Surely there is a way to turn it off.
Daniel Feenberg
The BEST way is to not use PROC EXPORT to create text files. It is trivial to write them using regular SAS code. In fact what you are complaining about is the ugly SAS code that PROC EXPORT generates. You can create a delimited text file, with headers, in a single data step. For one implementation of that method see this macro: https://github.com/sasutils/macros/blob/master/csv_vnext.sas
But probably the fastest way is to just modify your existing program to turn off the SOURCE option temporarily.
options nosource;
proc export data=sashelp.class file=csv dbms=dlm ;
run;
options source;
1474 options nosource; NOTE: The file CSV is: Filename=xxxx.csv, RECFM=V,LRECL=32767,File Size (bytes)=0, Last Modified=04May2019:22:38:58, Create Time=04May2019:22:38:58 NOTE: 20 records were written to the file CSV. The minimum record length was 17. The maximum record length was 26. NOTE: There were 19 observations read from the data set SASHELP.CLASS. NOTE: DATA statement used (Total process time): real time 0.05 seconds cpu time 0.00 seconds 19 records created in CSV from SASHELP.CLASS. NOTE: "CSV" file was successfully created. NOTE: PROCEDURE EXPORT used (Total process time): real time 0.14 seconds cpu time 0.00 seconds
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.