BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rakeshvvv
Quartz | Level 8

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

1 ACCEPTED SOLUTION

Accepted Solutions
Loko
Barite | Level 11

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

5 REPLIES 5
Loko
Barite | Level 11

Hello,

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

rakeshvvv
Quartz | Level 8

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

Cynthia_sas
Diamond | Level 26

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
LearnByMistk
Obsidian | Level 7

data _null_;

x=4;

  if x<5 then ;

 

  %put Error:dataset has duplicates;

  run;

Ksharp
Super User

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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