BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

Hello friends.

I have a question please.

Let's say that I have a sas program that  including a Macro.

Within the macro there is a long program that create a summary data with proc print(or proc report or proc tabulate).

The problem is that I run all the macros together before I leave my work  and when I come back to the computer I see in the print screen only print of the last macro Run.

What is the way to see proc prints that were created by all the macro runs?

 

%macro RRR(x,y,z);

long code.....

proc print data=Summary_tbl  noobs;

Run;

%mend RRR;

RRR(1,1,1);

RRR(1,1,2);

RRR(1,1,3);

RRR(1,2,1);

RRR(1,2,2);

RRR(1,2,3);

RRR(2,1,1);

RRR(2,1,2);

RRR(2,1,3);

RRR(2,2,1);

RRR(2,2,2);

RRR(2,2,3);

 

When It finish run all macros I see proc print of the last run only RRR(2,2,3);

What is the way to see proc prints that were created by all macros runs?

 

 

 

2 REPLIES 2
Shmuel
Garnet | Level 18

It seems that there is a statement in the macro code to clear the print screen.

You can either look for such a statement or post the code to get help or

alternatively append all final data-sets (summary_tbl) and run the proc print on the accumulated data-set.

 

What sas platform are you using?

r_behata
Barite | Level 11

You may consider redirecting the list output to a location which can be accessed once the macro execution is complete.

 

%macro RRR(x,y,z);

long code.....

proc printto  print="C:\temp\LSTLST_&x..lst" new;
run;


proc print data=Summary_tbl  noobs;

Run;


PROC PRINTTO; *The second PROC PRINTTO step redirects output back to its default destination.;
run;

%mend RRR;

RRR(1,1,1)
RRR(1,1,2)
RRR(1,1,3)
RRR(1,2,1)
RRR(1,2,2)
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
  • 993 views
  • 0 likes
  • 3 in conversation