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.

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore 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
  • 2 replies
  • 1596 views
  • 0 likes
  • 3 in conversation