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: 305

Re: Writing on listing file

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: 305

Re: Writing on listing file

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,739

Re: Writing on listing file

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

data _null_;

x=4;

  if x<5 then ;

 

  %put Error:dataset has duplicates;

  run;

Super User
Posts: 9,662

Re: Writing on listing file

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

☑ This topic is SOLVED.

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

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