BookmarkSubscribeRSS Feed
RajasekharReddy
Fluorite | Level 6

Hi ,

what option to display data step execution  /resolve values in LOG window

like we use MPRINT, SYMBOLGEN in Macro to see resolve values in log file

i want to see data step (like Do loop values )execution  /resolve values in log file

regards,

Rajasekhar Reddy

3 REPLIES 3
art297
Opal | Level 21

For $100: What is "put" and or "putlog"

PhilC
Rhodochrosite | Level 12

If this is base SAS then put and putlog. I don't know of any data step options, and I don't believe one exists. Of course the use of data steps are meant to process large amounts of data, so when reporting the value(s) of a variable(s) every time a data step loops would create even larger log files.

use putlog, especially if you are using put to output to a file. 

use this to report the value of a single variable to the log:

putlog var=;

use this to report all variables to the log:

putlog _all_;

Message was edited by: Philip Coltharp

ballardw
Super User

As mentioned you can generate LOTS of output; But PUT is conditional so if you are looking for specific values or combinations of value or missing values you can selectively report on them.

A brief example:

data new;

     Infile datasource;

     input <input a bunch of variables from the data source>;

     if DateOfBirth > DateOfService then put "ERROR: Date of Birth after Date of Service for ID " Idvar dateofbirth dateofservice;

run;

So I get a message in the log that we have some error related to two dates and identifying information.

Added benefit, if you start the message with ERROR: or WARNING: in upper case with the colon then the text in the log will appear with the colors you have set for error or warnings, default red and yellow respectively.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 773 views
  • 1 like
  • 4 in conversation