Karthik
Karthik

Reputation: 769

SAS command line - How to Avoid PROC GRAPH window

I have this problem when I run SAS 9.2 on the command line on a windows XP or a windows 7 machine.

It involves procedures that utilize the GRAPH feature in SAS. Consider this simple program below (call it 'test.sas'):

ods pdf file='c:\test.pdf';
data ds1;
    do x = 1 to 100;
        output;
    end;
run;

proc univariate data=ds1;
    var x;
    histogram; /* causes PROC Graph window to open 
                  when SAS is invoked from command line */
run;

ods pdf close;

When I run sas using the command line (i.e. sas -sysin test.sas) and when SAS generates the histogram in the PROC Univariate step, it opens a PROC GRAPH window and will not proceed without me clicking on that window. Since I am capturing the output into a PDF document using SAS ODS, I dont need the PROC GRAPH window to open. Another downside is that the SAS execution will not continue until I click on the PROC Graph window.

Is there any way to run this program on the command line without SAS opening the PROC GRAPH window and waiting for my input every time a histogram is requested?

Thanks.

Upvotes: 1

Views: 601

Answers (1)

BellevueBob
BellevueBob

Reputation: 9618

Yes, you just need to turn off the LISTING destination. Add "ods listing close;" to the beginning of your program.

Upvotes: 4

Related Questions