IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Issues with executing a REXX MACRO through JCL


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Jag Badal

New User


Joined: 25 Jun 2020
Posts: 6
Location: UK

PostPosted: Wed Jun 15, 2022 5:45 pm
Reply with quote

Hello,

I'm new to edit macros and I'm trying to execute a REXX macro through a batch job. The REXX code that I have written works perfectly well when I execute it using the 'TSO EXEC' command. However, it is not working when I try to execute it through the JCL.

After running it with TRACE option, I realized that it has got something to do ADDRESS/ISREDIT/ISPEXEC Statements as I'm getting RC -3 for them.

Can someone help me figure out what I'm doing wrong ?

Below are the JCL and REXX details -

Code:
//*********************************************************   
//*RUN REXX                                               *   
//*********************************************************   
//STEP02   EXEC PGM=IKJEFT01                                   
//SYSEXEC  DD DSN='ZXXXXXX.TEST.REXX',DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                         
//SYSTSPRT DD SYSOUT=*                                         
//SYSUT2   DD SYSOUT=*                                         
//SYSTSIN  DD *                                               
  %SARLIST2 'ZXXXXXX.USERA.REPORT1'                           
/*


Code:
/** REXX **/   
TRACE I                                   
ADDRESS TSO                               
ADDRESS ISREDIT "MACRO";;                 
ADDRESS ISREDIT ;;                       
/** SETTING PANEL LIBRARY **/                                                                                                   
PAN_LIB = TEST.REXX                                                     
ADDRESS TSO                                                             
"ALLOC FI(INPUT) DSN("PAN_LIB") SHR REUSE"                             
"ISPEXEC LIBDEF ISPPLIB DATASET ID("PAN_LIB")"                         
ADDRESS TSO PROFILE NOPREFIX                                           
                                                                       
/** GETTING VALUES FROM JCL  **/                                       
PARSE ARG REPORT                                                       
                                                                       
/** RETRIEVING REPORT VALUES **/                                       
    RPTDSN  = STRIP(REPORT)                                             
    SAY 'RPTDSN VALUE IS  ' RPTDSN          /* TEST */                 
/** EXECUTING MACRO TO EXTRACT JOB RUN DETAILS **/                     
       QL   = 'SARLIST'                                                 
       ADDRESS ISPEXEC 'VPUT (QL) PROFILE'                             
       ADDRESS ISPEXEC "VIEW DATASET("RPTDSN") MACRO(RPTMACRO)"         
       ADDRESS ISPEXEC 'VGET (OUTDSN) PROFILE'                         
       OUTDSNP = STRIP(OUTDSN)                                         
    SAY 'OUTDSNP VALUE IS ' OUTDSNP                                                                       
/**    ADDRESS ISPEXEC "VIEW DATASET("OUTDSNP")" **/


Thank you in advance!
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Wed Jun 15, 2022 6:01 pm
Reply with quote

-3 means that you have not established the ISPF environment.
Sample:
Code:
//ISP     EXEC PGM=IKJEFT1B                           
//SYSEXEC  DD DISP=SHR,DSN=your.exec                   
//SYSTSPRT DD SYSOUT=*                                 
//ISPMLIB  DD DISP=SHR,DSN=ISP.SISPMENU               
//ISPPLIB  DD DISP=SHR,DSN=ISP.SISPPENU               
//ISPSLIB  DD DISP=SHR,DSN=ISP.SISPSENU               
//ISPTLIB  DD DISP=SHR,DSN=ISP.SISPTENU               
//ISPPROF  DD UNIT=SYSDA,SPACE=(TRK,(1,1,1)),         
//            DCB=(ISP.SISPMENU)                       
//ISPLOG   DD SYSOUT=*,RECFM=VA,LRECL=125,BLKSIZE=129 
//ISPLST1  DD SYSOUT=*                                 
//ISPFILE  DD SYSOUT=*,RECFM=FB,LRECL=80,BLKSIZE=6240 
//SYSTSIN  DD *                                       
 ISPSTART CMD(your-command)                           
Back to top
View user's profile Send private message
Jag Badal

New User


Joined: 25 Jun 2020
Posts: 6
Location: UK

PostPosted: Wed Jun 15, 2022 7:21 pm
Reply with quote

I allocated ISPF libraries according to my system and it worked! icon_smile.gif

Thank you for your quick response!|
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Wed Jun 15, 2022 7:25 pm
Reply with quote

you are welcome, that one is a classic ;-)
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2594
Location: Silicon Valley

PostPosted: Wed Jun 15, 2022 10:18 pm
Reply with quote

Quote:
you have not established the ISPF environment

This was not mentioned nor indicated in the example:
You have to establish an ISPF environment AND you have to start an ISPF editor session in order to use editor macro statements.

(though, you do not actually do any editor stuff in your program - maybe remove the ISREDIT stuff from your rexx program).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts MacKinney Batch to CICS upgrade causi... CICS 7
No new posts Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts Executing DB2 SQL store procedure via... DB2 0
Search our Forums:

Back to Top