DATA Step, Macro, Functions and more

SAS interfcae to REXX

Reply
N/A
Posts: 0

SAS interfcae to REXX

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?
Respected Advisor
Posts: 3,777

Re: SAS interfcae to REXX

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_;
Super Contributor
Super Contributor
Posts: 3,174

Re: SAS interfcae to REXX

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.
N/A
Posts: 0

Re: SAS interfcae to REXX

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;
Super Contributor
Super Contributor
Posts: 3,174

Re: SAS interfcae to REXX

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
Ask a Question
Discussion stats
  • 4 replies
  • 282 views
  • 0 likes
  • 3 in conversation