BookmarkSubscribeRSS Feed
Siddhartha
Calcite | Level 5

Hi,

 

I  need to execute the  programs successfully and need to get the return code(rc=0) after the program completes successfully.

Can anyone help me, how to get the return code in the Log , whether the program is executed successfully with (retruncode)rc=0 and fails if rc >0.

 

Thanks & Regards,
Siddhartha

4 REPLIES 4
LinusH
Tourmaline | Level 20

Being a bit philosophic, how can one print something to a log, when the program have finished (assuming that the program is executed in batch)?

There some different return codes you can check, both SAS internal and system ones. And to add, the return code SAS leaves to the operating environment after termination (successful or not).

 

Please try to be more specific of when and how you wish to print this information.

Data never sleeps
RW9
Diamond | Level 26 RW9
Diamond | Level 26

The log itself is the return code.  If you need to check if the code ran sucessfully then you would post process the log to see if there are any errors, warnings, possibly some types of notes or keywords, and you would also probably check that any files it creates are present.  This is all post program run, hence why a lot of people have developed logcheck utilities to do scan the log.

 

Remember code can run fine, but may still have probelms within it.

Tom
Super User Tom
Super User

Wrap the SAS program inside of another one.  Either another SAS program or another script in whatever language you want.

Ksharp
Super User
data x;
set sashelp.class;
run;
%put WARNING: &syscc rc=&sysrc &syserr &syserrortext &syswarningtext;

data x;
set sashelp.class;
x=input(sex,8);
run;
%put WARNING: &syscc rc=&sysrc &syserr &syserrortext &syswarningtext;

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!

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.

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
  • 4 replies
  • 2513 views
  • 0 likes
  • 5 in conversation