BookmarkSubscribeRSS Feed
MarcinP1980
Calcite | Level 5

Hi,

I would like to create a nice summary of what macro has done in the SAS log window, so users see exactly what happened. For that reason, I have prepared a dataset and would like to route it to the log window with proc report or other printing procedure.

In batch mode, this can be done with 

filename outfile "location of log file";

proc printto file=outfile new;
run;

 

Could this be done in any way also in interactive runs? I wouldn't want to use put statements or anything like that as formatting of information becomes quite difficult. Below please see an example of what I would like to go into the log:

Package
     Dependency                 Dependency type     Version        Download Status
------------------------------------------------------------------------------------------------------------
VIM 6.0.0                                                                                Downloaded
     car                                Depends                   >=1.9.4 
     colorspace                    Depends
     MASS                           Imports

 

Thanks in advance,

Marcin                  

2 REPLIES 2
Shmuel
Garnet | Level 18

You can use same method while running SAS interactively as when running batch.

Try it.

Tom
Super User Tom
Super User

Just do the same thing. Use a temporary file if you don't need the extra copy.

filename thisrun temp; 
proc printto print=thisrun new;
run;
proc print data=sashelp.class; run;
proc printto print=print; run;
data _null_;
  infile thisrun;
  input;
  put _infile_;
run;
7922  data _null_;
7923    infile thisrun;
7924    input;
7925    put _infile_;
7926  run;

NOTE: The infile THISRUN is:

      Filename=...\#LN00057,
      RECFM=V,LRECL=32767,File Size (bytes)=1113,
      Last Modified=11Dec2020:11:59:24,
      Create Time=11Dec2020:11:59:24

SAS 9.4 on WINDOWS                                                       16:48 Monday, December 7, 2020  77

Obs    Name       Sex    Age    Height    Weight

  1    Alfred      M      14     69.0      112.5
  2    Alice       F      13     56.5       84.0
  3    Barbara     F      13     65.3       98.0
  4    Carol       F      14     62.8      102.5
  5    Henry       M      14     63.5      102.5
  6    James       M      12     57.3       83.0
  7    Jane        F      12     59.8       84.5
  8    Janet       F      15     62.5      112.5
  9    Jeffrey     M      13     62.5       84.0
 10    John        M      12     59.0       99.5
 11    Joyce       F      11     51.3       50.5
 12    Judy        F      14     64.3       90.0
 13    Louise      F      12     56.3       77.0
 14    Mary        F      15     66.5      112.0
 15    Philip      M      16     72.0      150.0
 16    Robert      M      12     64.8      128.0
 17    Ronald      M      15     67.0      133.0
 18    Thomas      M      11     57.5       85.0
 19    William     M      15     66.5      112.0
NOTE: 23 records were read from the infile THISRUN.
      The minimum record length was 0.
      The maximum record length was 107.
NOTE: DATA statement used (Total process time):
      real time           0.06 seconds
      cpu time            0.01 seconds

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 503 views
  • 0 likes
  • 3 in conversation