Help using Base SAS procedures

Writing on listing file

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 145
Accepted Solution

Writing on listing file

Hi

We use the following statement to write into log file…

%put ERROR: Dataset contains duplicate records.

Is there a way that I can write same on the listing file….

Thanks


Accepted Solutions
Solution
‎11-06-2014 12:02 PM
Super Contributor
Posts: 308

Re: Writing on listing file

Posted in reply to rakeshvvv

Hello,

%put macro statement only writes to the log. You can try generating a data _null_ statement with a put data step statement.

View solution in original post


All Replies
Solution
‎11-06-2014 12:02 PM
Super Contributor
Posts: 308

Re: Writing on listing file

Posted in reply to rakeshvvv

Hello,

%put macro statement only writes to the log. You can try generating a data _null_ statement with a put data step statement.

Frequent Contributor
Posts: 145

Re: Writing on listing file

CAN YOU GIVE ME AN EXAMPLE......

SAS Super FREQ
Posts: 8,862

Re: Writing on listing file

Posted in reply to rakeshvvv

Hi:

  Here's an example. See attached screen shot. There's also a free e-lecture on the topic: SAS Training in the U.S. -- SAS Report Writing 1 e-Lectures: Additional Topics (Creating Data Step Reports with the LISTING Destination).

cynthia


data_null_to_listing.png
Contributor
Posts: 28

Re: Writing on listing file

Posted in reply to rakeshvvv

data _null_;

x=4;

  if x<5 then ;

 

  %put Error:dataset has duplicates;

  run;

Super User
Posts: 10,018

Re: Writing on listing file

Posted in reply to rakeshvvv

Why not use proc printto to save the LOG into a listing file ?

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 261 views
  • 3 likes
  • 5 in conversation