BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

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)

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 25. 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
  • 555 views
  • 0 likes
  • 3 in conversation