BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I am trying to execute a REXX program from a SAS step. I have written the below code but the REXX code is not getting executed.

//REXXSTEP EXEC PGM=IEBUPDTE,REGION=1024K,
// PARM='NEW'
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DSN=&&TEMP1,
// DISP=(NEW,KEEP,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PO),
// SPACE=(CYL,(1,1,10)),UNIT=TEMPDISK
//SYSIN DD *
./ ADD NAME=TESTREXX
/**********************REXX******/
SAY ' IN REXX'
ADDRESS TSO "ALLOC DA('NW4G.TEST') NEW CATALOG",
"DSORG(PS) RECFM(FB) LRECL(80) BLOCK SPACE(1,1) CYL"
IF RC = 0 THEN
SAY 'ALLOC SUCCESSFUL"
ELSE
SAY 'RC' RC
./ ENDUP
//STEP30 EXEC SAS
//SYSOUT DD SYSOUT=*
//SASREXX DD DSN=&TEMP1,DISP=(OLD,DELETE,DELETE)
//SYSIN DD *
OPTIONS REXXMAC;
TESTREXX;

Could you let me know what is the problem with this code? If REXX program gets executed then where can we see the output messages from REXX program. Also can't we execute a REXX program from a SAS DATA step?
4 REPLIES 4
data_null__
Jade | Level 19
Do you also need REXXLOC=ddname SAS system option?
[pre]
http://support.sas.com/documentation/cdl/en/hosto390/61886/HTML/default/mvs-sysops-rexxloc.htm
[/pre]

Never mind I see that REXXMAC is the default.

So the question is does you REXXMAC DD point to the same maclib you create in the IEBUPDTE step? Message was edited by: data _null_;
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Without learning your exact batch job error, I would say that the correct JCL DD DISP= for your "temporary PDS library" is:

DISP=(NEW,PASS)


Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
After I changed the DISP of temp PDS library to DISP=(NEW,PASS), the REXX program got executed. I have verified this by adding the SASLOG statement in REXX (ADDRESS SAS "++SASLOG Control is IN REXX pgm" ).

In the output report FT11F001 (is it SASLOG??), output "Control is IN REXX pgm" was shown. However, no statements got executed after this (ADDRESS TSO, IF statements). No output was shown regarding dataset allocation. Is there any problem with subcommand environment? Thank you for helping out.

//REXXSTEP EXEC PGM=IEBUPDTE,REGION=1024K,
// PARM='NEW'
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DSN=&TEMP1,
// DISP=(NEW,PASS,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PO),
// SPACE=(CYL,(1,1,10)),UNIT=TEMPDISK
//SYSIN DD *
./ ADD NAME=TESTREXX
/**********************REXX******/
ADDRESS SAS "++SASLOG IN REXX"
ADDRESS TSO "ALLOC DA('NW4G.TEST') NEW CATALOG",
"DSORG(PS) RECFM(FB) LRECL(80) BLOCK SPACE(1,1) CYL"
IF RC = 0 THEN
ADDRESS SAS "++SASLOG ALLOC SUCCESSFUL"
ELSE
ADDRESS SAS "++SASLOG ALLOC UNSUCCESSFUL" RC
./ ENDUP
//STEP30 EXEC SAS
//SYSOUT DD SYSOUT=*
//SASREXX DD DSN=&TEMP1,DISP=(OLD,DELETE,DELETE)
//SYSIN DD *
OPTIONS REXXMAC ;
TESTREXX;
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You will need to debug your SAS execution further by changing to different code in order to assess the expected or unexpected behavior or contact SAS support to open a track and share all output with them. Suggest you inspect all job output closely for any suspicious diagnostic messages.

Also, you mentioned FT11F001 - that SAS log output destination went away with SAS version 6 (normally), unless your site still has CONFIG options overridden.
What is your SAS version? Still you will need to do your own debugging here or contact SAS support.


Scott

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1724 views
  • 0 likes
  • 3 in conversation