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

Run rexx in batch job


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mox512

New User


Joined: 04 Feb 2024
Posts: 24
Location: united arab emirates

PostPosted: Sat Dec 07, 2024 5:06 pm
Reply with quote

"I have written a REXX job on z/OS version 2.1 that backs up a dataset with the high-level qualifier (HLQ) CSC. When I execute the job directly using the EX command, it works correctly. However, when I run the same job through a batch JCL, it fails to work. How can I resolve this issue?"
REXX code:

Code:
/*REXX*/                                                               
DTIME = SUBSTR(DATE('S'),5)                                             
I=0                                                                     
QUEUE "//BACKDST JOB MSGLEVEL=(1,1),REGION=0M,CLASS=A,NOTIFY=&SYSUID"   
QUEUE "//***********************************************************"   
QUEUE "//*            STEP01: DELETE BACKUP HLQ=BKUP41             *"   
QUEUE "//***********************************************************"   
QUEUE "//DELDS1    EXEC PGM=ADRDSSU,REGION=0M"                         
QUEUE "//SYSPRINT  DD   SYSOUT=*"                                       
QUEUE "//DELETE    DD   DUMMY"                                         
QUEUE "//SYSIN     DD   *"                                             
QUEUE "  DUMP DATASET(INCLUDE(BKUP41.**) -"                             
QUEUE "    BY((CREDT,LT,*,-7))) - "                                     
QUEUE "    OUTDD(DELETE) DELETE "                                       
/*        STEP01: BACKUP DBA FILES HLQ */                               
"ISPEXEC LMDINIT LISTID(IDV) LEVEL(CSC)"                               
DO FOREVER                                                             
I=I+1                                                                   
   "ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)"         
   IF RC = 0 THEN DO                                                   
QUEUE "//***********************************************************"   
QUEUE "//STEP"I"  EXEC PGM=IKJEFT01,COND=(5,LE,DELDS1)"                 
QUEUE "//SYSPRINT DD SYSOUT=*"                                         
QUEUE "//SYSTSPRT DD SYSOUT=*"                                         
QUEUE "//SYSTSIN    DD *"                                               
QUEUE "  XMIT A.A DSN('"DSVAR"') -"                                     
QUEUE "  OUTDSN('BKUP41."DSVAR".T"DTIME"')"                             
END                                                                     
   ELSE LEAVE                               
END                                         
"ISPEXEC LMDLIST LISTID("IDV") OPTION(FREE)"

JCL Batch JOB is:
Code:
//BACKDST  JOB  CLASS=A,NOTIFY=&SYSUID                 
//EREPMTN  EXEC PGM=IKJEFT01,REGION=0K,PARM='BACKDST'
//SYSEXEC  DD DSN=JOB.TEST,DISP=SHR             
//SYSTSPRT DD SYSOUT=*                                 
//SYSTSIN  DD DUMMY,BLKSIZE=80
 
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2146
Location: USA

PostPosted: Sat Dec 07, 2024 8:28 pm
Reply with quote

What and how exactly "fails"?

Quote:
My car is not working. What should I do?
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 736
Location: Denmark

PostPosted: Sat Dec 07, 2024 9:59 pm
Reply with quote

You don't have the required JCL for ISPF in batch.
Sample:
Code:
//ISP     EXEC PGM=IKJEFT1B                             
//SYSEXEC  DD DISP=SHR,DSN=your.EXEC                   
//SYSTSPRT DD SYSOUT=*                                 
//MLRPT    DD SYSOUT=*                                 
//MLLST    DD SYSOUT=*                                 
//ISPMLIB  DD DISP=SHR,DSN=ISP.SISPMENU                 
//ISPPLIB  DD DISP=SHR,DSN=ISP.SISPPENU                 
//ISPSLIB  DD DISP=SHR,DSN=ISP.SISPSENU                 
//ISPPROF  DD UNIT=SYSDA,SPACE=(TRK,(1,1,1))                             
//ISPTLIB  DD DISP=SHR,DSN=ISP.SISPTENU                 
//ISPLOG   DD SYSOUT=*,RECFM=VA,LRECL=125,BLKSIZE=129   
//ISPFILE  DD SYSOUT=*,RECFM=FB,LRECL=80,BLKSIZE=6240   
//SYSTSIN  DD *                                         
 ISPSTART CMD(%MLCOMP)       
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1338
Location: Bamberg, Germany

PostPosted: Sun Dec 08, 2024 2:04 am
Reply with quote

What is this for? Not needed IMO.
Code:
//MLRPT    DD SYSOUT=*                                 
//MLLST    DD SYSOUT=*
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 736
Location: Denmark

PostPosted: Sun Dec 08, 2024 3:54 pm
Reply with quote

Sorry, I just took the JCL from a existing job and overlooked those 2, they are not needed in general.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 736
Location: Denmark

PostPosted: Mon Dec 09, 2024 12:01 am
Reply with quote

Also, the ISPPROF must have a DCB, like:
Code:
//ISPPROF  DD UNIT=SYSDA,SPACE=(TRK,(1,1,1)),
//            DCB=(ISP.SISPMENU)             
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1338
Location: Bamberg, Germany

PostPosted: Mon Dec 09, 2024 2:07 pm
Reply with quote

Willy Jensen wrote:
Also, the ISPPROF must have a DCB, like:
Code:
//ISPPROF  DD UNIT=SYSDA,SPACE=(TRK,(1,1,1)),
//            DCB=(ISP.SISPMENU)             

Although not really necessary, I used to add here DSNTYPE=LIBRARY
Back to top
View user's profile Send private message
mox512

New User


Joined: 04 Feb 2024
Posts: 24
Location: united arab emirates

PostPosted: Mon Dec 09, 2024 9:17 pm
Reply with quote

Thank You, I change My job and it's working:
Code:

//BACKUP  JOB MSGLEVEL=(1,1),REGION=0M,CLASS=A,NOTIFY=&SYSUID
//STEP1    EXEC PGM=IKJEFT1B                                 
//SYSEXEC  DD DISP=SHR,DSN=USER.JOBS                     
//ISPLLIB  DD DISP=SHR,DSN=ISP.SISPLOAD                       
//ISPPLIB  DD DISP=SHR,DSN=ISP.SISPPENU                       
//ISPSLIB  DD DISP=SHR,DSN=ISP.SISPSLIB                       
//ISPTLIB  DD DISP=SHR,DSN=ISP.SISPTENU                       
//ISPMLIB  DD DISP=SHR,DSN=ISP.SISPMENU                       
//ISPPROF  DD DISP=OLD,DSN=USER.ISPF.ISPPROF               
//SYSPRINT DD SYSOUT=*                                       
//SYSTSPRT DD SYSOUT=*                                       
//SYSTSIN  DD *                                               
 ISPSTART CMD(%#REXX)                                     
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 -> CLIST & REXX

 


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 Does anyone know rexx for VSE CLIST & REXX 3
No new posts Excuting store procedure via JCL batch JCL & VSAM 1
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
Search our Forums:

Back to Top