MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

JCL to Pass Command REXX Program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
jayram99
Beginner


Joined: 16 Aug 2004
Posts: 52
Topics: 21
Location: falls church.va,usa

PostPosted: Wed Sep 01, 2021 8:23 pm    Post subject: JCL to Pass Command REXX Program Reply with quote

Hi ,

I need help from REXX Experts to Automate Script since this is first time I'm working on the REXX.

We got REXX Programs from Vendor and need to execute the Program by passing export command as Parameters.

Right Now We are executing Manually as below.

1. Execute the below PDS using EX(EXEC) Command


EX EN19.AXTY.V6R2M0.USERLIB(E19NCMD)

EN19.AXTY.V6R2M0.USERLIB(E19NCMD)
Code:


   /*REXX*/
   "ALLOCATE DSN('SYS3.ABCD.V6R2M0.DEF.GBLPARMS') DDNAME(GBLPARMS) SHR"
   "ALLOCATE DSN('SYS3.ABCD.V6R2M0.DEF.NVCMDPRM') DDNAME(NVCMDPRM) SHR"
   "ALLOCATE,DDNAME(TASKLIB),DA('SYS3.ABCD.V6R2M0.LOAD'
   "EXEC 'EN19.AXTY.V6R2M0.USERLIB(E19FCALL)'         ------> Please see below code of EN19FCALL
       'TASKLIB NAVUTIL P('''')' "
   "FREE DDNAME(TASKLIB)"
   "FREE DDNAME(GBLPARMS)"
   


The above REXX Programs another sub program E19FCALL

'EN19.AXTY.V6R2M0.USERLIB(E19FCALL) Code Below

Code:
 
   PROC 2 DDNAME MEM P()  DEBUG PREFIX(SYS3.ABCD.V6R2M0)
   IF &DEBUG = DEBUG THEN  CONTROL  MAIN LIST CONLIST SYMLIST MSG
              ELSE  CONTROL  MAIN NOLIST NOCONLIST NOSYMLIST NOMSG
   IF &DDNAME NE TASKLIB THEN DO
      WRITE DDNAME MUST BE SET TO TASKLIB
      EXIT CODE(998)
      END
   CALL  '&PREFIX..LOAD(FCALL)' '&MEM,&P'
   SET &RC    = &LASTCC
   IF &RC NE 0 THEN WRITE >>>>>>> --FCALL-- RC = &RC
   IF      &SUBSTR(1:1,&RC) = S THEN SET &RC = 999
   ELSE IF &SUBSTR(1:1,&RC) = U THEN SET &RC = &SUBSTR(2:5,&RC)
   FREE  DA('&PREFIX..LOAD')
   EXIT  CODE(&RC)
   END
   
   


After Executing with the EX Command, received interactive command prompt as below

Local>

Following command will be provided

Code:
 
  export binding E19_DR_LAU_AG  TSO.F123.DRLAUAG.BINDING.XML
 


I need help to call the Above REXX Program (EN19.AXTY.V6R2M0.USERLIB(E19NCMD)) using JCL and pass
export binding E19_DR_LAU_AG TSO.F123.DRLAUAG.BINDING.XML as parameter using dataset. The Dataset will be having export command.

Please Advise. Thank you for your help.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Thu Sep 02, 2021 7:02 am    Post subject: Reply with quote

jayram99,


You need to set up ISPF before you can run REXX exec in batch. Check this topic

https://www.mvsforums.com/helpboards/viewtopic.php?t=5276

Here is a batch version for running your rexx

Code:

//***************************************                 
//* ALLOCATE THE TEMP PROFILE AND CLIST *                 
//***************************************                 
//STEP0050 EXEC PGM=IEBGENER                             
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD *                                           
 SET ZISPFRC = 0                                         
 ISPEXEC VPUT (ZISPFRC) SHARED                           
//SYSUT2   DD DSN=&&CLIST0(TEMPNAME),                     
//            DISP=(NEW,PASS),                           
//            UNIT=SYSALLDA,                             
//            SPACE=(TRK,(1,1,2),RLSE),                   
//            DCB=(LRECL=80,BLKSIZE=0,DSORG=PO,RECFM=FB) 
//PROFILE  DD DSN=&SYSUID..TPROF,                         
//            DISP=(NEW,CATLG),                           
//            UNIT=SYSALLDA,                             
//            SPACE=(TRK,(10,10,5)),                     
//            DCB=(LRECL=80,BLKSIZE=0,DSORG=PO,RECFM=FB) 
//SYSIN    DD DUMMY
//* 
//***************************************
//* RUN IN BATCH MODE THE REXX EXEC     *
//***************************************
//STEP0100 EXEC PGM=IKJEFT01,DYNAMNBR=50
//SYSTSPRT DD SYSOUT=*
//ISPPLIB  DD DISP=SHR,DSN=ISP.SISPPENU                       
//ISPSLIB  DD DISP=SHR,DSN=ISP.SISPSLIB                       
//         DD DISP=SHR,DSN=ISP.SISPSENU                       
//ISPMLIB  DD DISP=SHR,DSN=ISP.SISPMENU                       
//ISPPROF  DD DSN=&SYSUID..TPROF,DISP=(OLD,PASS)               
//ISPTABL  DD DSN=&SYSUID..TPROF,DISP=(OLD,PASS)               
//ISPTLIB  DD DSN=&SYSUID..TPROF,DISP=(OLD,PASS)               
//         DD DISP=SHR,DSN=ISP.SISPTENU                       
//ISPCTL0  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),           
//            DCB=(LRECL=80,BLKSIZE=0,DSORG=PS,RECFM=FB)       
//ISPCTL1  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),           
//            DCB=(LRECL=80,BLKSIZE=0,DSORG=PS,RECFM=FB)       
//ISPWRK1  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),           
//            DCB=(LRECL=80,BLKSIZE=0,DSORG=PS,RECFM=FB)       
//ISPLST1  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),           
//            DCB=(LRECL=133,BLKSIZE=0,DSORG=PS,RECFM=VB)     
//ISPLOG   DD SYSOUT=*,                                       
//            DCB=(LRECL=120,BLKSIZE=2400,DSORG=PS,RECFM=FB)   
//ISPLIST  DD SYSOUT=*,DCB=(LRECL=121,BLKSIZE=1210,RECFM=FBA) 
//SYSEXEC  DD DISP=SHR,DSN=Your.Pds.containing.rexx.exec
//SYSPROC  DD DSN=&&CLIST0,DISP=(OLD,DELETE)                   
//         DD DISP=SHR,DSN=ISP.SISPCLIB                       
//*                                                           
//SYSTSIN  DD *                                               
  PROFILE PREFIX(your.userid)
  ISPSTART CMD(your.rexx.exec) PARM(your.parm)
/*
//***************************************                     
//* DELETE THE TEMP PROFILE             *                     
//***************************************                     
//DELPROF  EXEC PGM=IEFBR14                                   
//DELETEDD DD DSN=&SYSUID..TPROF,DISP=(OLD,DELETE)               

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jayram99
Beginner


Joined: 16 Aug 2004
Posts: 52
Topics: 21
Location: falls church.va,usa

PostPosted: Fri Sep 03, 2021 9:07 am    Post subject: Reply with quote

Thanks Kolusu .
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group