View previous topic :: View next topic
|
Author |
Message |
Jag Badal
New User
Joined: 25 Jun 2020 Posts: 6 Location: UK
|
|
|
|
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 |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
-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 |
|
|
Jag Badal
New User
Joined: 25 Jun 2020 Posts: 6 Location: UK
|
|
|
|
I allocated ISPF libraries according to my system and it worked!
Thank you for your quick response!| |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
you are welcome, that one is a classic ;-) |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
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 |
|
|
|