02.05.2013 Views

SAS(R) 9.1.3 Companion for z/OS

SAS(R) 9.1.3 Companion for z/OS

SAS(R) 9.1.3 Companion for z/OS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Checking the <strong>SAS</strong> Return Code in a REXX Exec<br />

<strong>SAS</strong> Interfaces to ISPF and REXX Examples of REXX Execs 205<br />

This REXX exec, called SHOWRC, demonstrates how the REXX variable RC can be<br />

tested after a <strong>SAS</strong> step has run:<br />

/*-------------- REXX exec SHOWRC ------------*/<br />

/* Accepts as argument a <strong>SAS</strong> data set */<br />

Parse Upper Arg ds_name .<br />

Address <strong>SAS</strong> ’++<strong>SAS</strong>LOG’<br />

"data newdata; "<br />

" set "ds_name"; "<br />

" run; "<br />

If rc = 0 Then<br />

Say ’<strong>SAS</strong> DATA step completed successfully’<br />

Else<br />

Say ’<strong>SAS</strong> DATA step terminated with rc=’ rc<br />

Exit

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!