BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
braam
Quartz | Level 8

Dear All,

 

My code doesn't work as intended. What I want to do is to save two results in ODS DOCUMENT named temporary and to recall them later by using PROC DOCUMENT.

 

When I run the code once, it seemed that it worked given that there was no error. PROC DOCUMENT also showed two results from previous PROC PRINT.

 

But when I run the code again (i.e., twice), PROC DOCUMENT showed "two times" of what I expect to see. It implies that ODS DOCUMENT CLOSE didn't work as I intended. Instead, ODS DOCUMENT seems to keep recording the code that has been executed. Did I do something wrong? Thanks for reading.

 

ods document name= temporary;
proc print data= sashelp.cars (obs= 10); run;
proc print data= sashelp.stocks (obs= 10);run;

ods document close;

proc document name= temporary; replay; run; quit;

 

 

1 ACCEPTED SOLUTION
2 REPLIES 2
Kurt_Bremser
Super User

When I run your code:

ods document name=temporary;

proc print data= sashelp.cars (obs=10);
run;

proc print data= sashelp.stocks (obs=10);
run;

ods document close;

proc document name=temporary;
replay;
run;
quit;

repeatedly, I always get the same output: PRINT for cars and stocks from the original call, and then again from the REPLAY.

 

 

Cancel the above; I had only the PROC DOCUMENT marked when hitting "submit".

SIG_NOT_ENOUGH_COFFEE.

SAS Innovate 2025: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 514 views
  • 0 likes
  • 3 in conversation