SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASuserlot
Barite | Level 11

I am running the proc rank and proc reg procedures. However it generating the 100's pictures  of plots based on my macro . These pictures are saving the same location where my program saved. Is there any way I can avoid this? Is  "ods listing" causing this? I am giving my generalized code. please let me. Thanks.

 ods listing;
proc rank data=bytrt(where=(trtan in (&num,5))) out=out#
     by lbtestcd &extraby;
     where safepop=1 & 
           lbcfb^=. & lbbase^=. & lbendfl=1  
           ;
     var LBCFB LBBASE;
     ranks KLBCFB KLBBASE;
   run;
   
   proc reg data=OUT&num(where=(trtan in (&num,5)));
   where safepop=1 &) & 
         lbcfb^=. & lbbase^=. & lbendfl=1 ;
     by lbtestcd &extraby;
     model KLBCFB = KLBBASE;
     output out=RESIDUAL&num r=RESID;
   run;
  ods listing close;
1 ACCEPTED SOLUTION

Accepted Solutions
maguiremq
SAS Super FREQ

You can also include a PLOTS = NONE option on the PROC REG statement.

 

   proc reg data=OUT&num(where=(trtan in (&num,5))) plots = none;
   where safepop=1 &) & 
         lbcfb^=. & lbbase^=. & lbendfl=1;
     by lbtestcd &extraby;
     model KLBCFB = KLBBASE;
     output out=RESIDUAL&num r=RESID;
   run;

 Looking at your code, though, I'm a bit confused. Seems as though there are some out-of-place parentheses and ampersands. Here's what I'm trying to convey:

proc reg data = sashelp.cars plots = none;
	model msrp = cylinders mpg_city mpg_highway;
run;
quit;

View solution in original post

4 REPLIES 4
FreelanceReinh
Jade | Level 19

Hello @SASuserlot,

 

First I would add:

ods graphics off;

For a few more things that can be suppressed in order to avoid clutter (and reduce run time) see Rick Wicklin's little macro ODSOff in Re: how slow would the TTest procedure be ?

 

 

maguiremq
SAS Super FREQ

You can also include a PLOTS = NONE option on the PROC REG statement.

 

   proc reg data=OUT&num(where=(trtan in (&num,5))) plots = none;
   where safepop=1 &) & 
         lbcfb^=. & lbbase^=. & lbendfl=1;
     by lbtestcd &extraby;
     model KLBCFB = KLBBASE;
     output out=RESIDUAL&num r=RESID;
   run;

 Looking at your code, though, I'm a bit confused. Seems as though there are some out-of-place parentheses and ampersands. Here's what I'm trying to convey:

proc reg data = sashelp.cars plots = none;
	model msrp = cylinders mpg_city mpg_highway;
run;
quit;
SASuserlot
Barite | Level 11

Thanks, it worked. I deleted some code, because it have some project related code. Thanks again.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 879 views
  • 2 likes
  • 3 in conversation