2
votes

I was doing a PCA analysis with SAS using the following code:

ods output Eigenvectors=PRINCEEV Eigenvalues=PRINCEEVAL;
proc princomp data=REPLACED PLOTS=SCORE(ELLIPSE NCOMP=5) NOPRINT;
    id time; 
run;
ods output close;

Because the lst files this analysis produces is too large, I used the NOPRINT option. However, it seems that the NOPRINT option also eliminates all of my ODS outputs. (Now PRINCEEV and PRINCEEVAL are all empty):

ERROR: File WORK.PRINCEEVAL.DATA does not exist.
ERROR: Export unsuccessful.  See SAS Log for details.
259                                                                         putn

_______
                                                                            1
259      ! ame=YES;   run;
WARNING 1-322: Assuming the symbol PUTNAMES was misspelled as putname.

ERROR: File WORK.PRINCEEV.DATA does not exist.
ERROR: Export unsuccessful.  See SAS Log for details.
ERROR: Errors printed on page 1.

Is there a way to suppress the generation of lst file, without affecting the ods output?

UPDATE:

It seems that according to the following sas blog, it is not possible to do that:

Can you combine NOPRINT and ODS OUTPUT?

SAS programmers crave efficiency. Upon reading that the NOPRINT option can make a procedure run faster, the ambitious programmer might attempt to run a procedure with the NOPRINT option but use the ODS OUTPUT statement to capture the results of one table. Sorry, friend, but you can't do that. The NOPRINT option means that no ODS tables are created, so there is no way to select a table and save it to a data set.

But the dilemma is, I have limited space on the cloud computing server. The lst files are doing nothing but wasting my spaces. Deleting the lst files when SAS programs are running with external processes will also produce an io error in SAS (I already tried that).

Is there anyway around?

3

3 Answers

4
votes

I would suggest:

ods listing close ;

ods output Eigenvectors=PRINCEEV Eigenvalues=PRINCEEVAL;
proc princomp data=REPLACED PLOTS=SCORE(ELLIPSE NCOMP=5) NOPRINT;
    id time; 
run;
ods output close;

This will close the listing destination, so should work fine.

I noticed in a related blog post, Rick argued for:

ods exclude _all_ ;

http://blogs.sas.com/content/iml/2015/05/28/five-reasons-ods-exclude.html

0
votes

Minor change to the previous answer: remove the NOPRINT option and after the ODS OUTPUT is created open up the ods listing if you have further code.

ods listing close ;
ods output Eigenvectors=PRINCEEV Eigenvalues=PRINCEEVAL;
proc princomp data=REPLACED PLOTS=SCORE(ELLIPSE NCOMP=5) /*NOPRINT*/;
    id time; 
run;
ods output close;
ODS LISTING;
0
votes

If you execute your sas-script on your cloud computing server via bash, then you can send your .lst files to /dev/null:

sas -print /dev/null script.sas

The -print option only effects your .lst, but not any ODS related outputs.