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

batch job rexx need to edit pds job


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

New User


Joined: 10 Apr 2007
Posts: 6
Location: fishers in

PostPosted: Thu Jun 03, 2010 1:25 am
Reply with quote

Hi!
i am tring to setup a batch job that will edit a pds job to replace some of the characters. c '?' 'F'.
any help would be appreciated
thanks
jim
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 03, 2010 1:42 am
Reply with quote

jim,

is your requirement:

1. batch job to modify members of PDS.
2. modification consists of ?

where are you in this endevor?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jun 03, 2010 1:46 am
Reply with quote

The IPOUPDTE utility is always handy for simple "change all A to B" types of edits. TSO EDIT is also handy as well and is easily supported in a batch job.
Back to top
View user's profile Send private message
jxsutton

New User


Joined: 10 Apr 2007
Posts: 6
Location: fishers in

PostPosted: Thu Jun 03, 2010 2:04 am
Reply with quote

tring to edit a set of jcl on a pds. this works in online but the batc gets a rc20. here is the code
Code:
ESPCALL:                                         
 /************************ESPCALL*****************
FROMTXT = "'//* SUBMITTED FROM "FROMDSN"'"       
                                                 
 ADDRESS ISREDIT                                 
 "C ALL '?' (DB)"                                 
 "C ALL '!' (REG)"                               
                                                 
 ADDRESS TSO                                     
IF REG == "1" THEN                               
   DO                                             
       ADDRESS ISREDIT                           
       "C ALL '$$$$.PROC' 'SMN1.PROC'"           
   END                                           
if there is some one who can tell me what is the right edit to use in batch
in the manuals i have looked at i did not see it
thanks
jim
Back to top
View user's profile Send private message
jxsutton

New User


Joined: 10 Apr 2007
Posts: 6
Location: fishers in

PostPosted: Thu Jun 03, 2010 2:19 am
Reply with quote

Code:
ESPCALL:                                         
 /************************ESPCALL*****************
FROMTXT = "'//* SUBMITTED FROM "FROMDSN"'"       
                                                 
 ADDRESS ISREDIT                                 
 "C ALL '?' (DB)"                                 
 "C ALL '!' (REG)"                               
                                                 
 ADDRESS TSO                                     
IF REG == "1" THEN                               
   DO                                             
       ADDRESS ISREDIT                           
       "C ALL '$$$$.PROC' 'SMN1.PROC'"           
   END                                           
this is where i am . i have moved the jobs to a differnt pds and need to read the job and moify the job card and some other characters
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 03, 2010 2:27 am
Reply with quote

Running ISPF Edit Macros in Batch

a little old but close.
Back to top
View user's profile Send private message
jxsutton

New User


Joined: 10 Apr 2007
Posts: 6
Location: fishers in

PostPosted: Thu Jun 03, 2010 2:37 am
Reply with quote

i am tying to setup a automatic job that can run thru ESP daily to setup jcl
. i could do it online but that means i would have to do it evert mornig
thanks
Back to top
View user's profile Send private message
jxsutton

New User


Joined: 10 Apr 2007
Posts: 6
Location: fishers in

PostPosted: Thu Jun 03, 2010 2:41 am
Reply with quote

I am looking for the mauls that displays thr differanc between batch and online when it comes to edits
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 03, 2010 3:20 am
Reply with quote

Hello,

I'm not aware of a manual that shows "edit differences" between batch and online.

It may be that your batch job does not establish an ispf environment. . .

If may help if you post your jcl and what is being executed.
Back to top
View user's profile Send private message
jxsutton

New User


Joined: 10 Apr 2007
Posts: 6
Location: fishers in

PostPosted: Thu Jun 03, 2010 3:58 am
Reply with quote

here is the jcl
Code:
//E3351ESP JOB (DACP),'AUTO BUILD ESP DLY',                       
//             NOTIFY=&SYSUID,                                     
//             CLASS=A,MSGCLASS=X,REGION=0M                       
//*ISPF EDIT OF E33513.PDS.JCL(AUTOESP)                           
//*****************************************************************
//INIT SET DB='F',REG='8'                                         
//*****************************************************************
//JOBSTEP EXEC PGM=IKJEFT01,DYNAMNBR=200,PARM='ESPGEN &REG &DB'   
//SYSEXEC  DD DSN=ALSQ0.QA.CLIST,DISP=SHR                         
//SYSPRINT DD SYSOUT=*                                             
//SYSOUT   DD SYSOUT=*                                             
//SYSTSPRT DD SYSOUT=*                                             
//SYSTSIN  DD *                                                   
PROFILE PREFIX(@USER)                                             
//* %ESPGEN                                                       
/*   
here is most of the rexx 
/*REXX*/                                                               
/*                                                                    */
 PARSE ARG STR1 STR2                                                   
   REG = (STR1)                                                         
    DB = (STR2)                                                         
/*        PARSE ARG REG DB MMDDYY DCYCLE                  */           
/*1.      READ DRIVER FILE AND SUBMIT THE JOBS            */           
/* *************************************************************** */   
/*  EDIT FOR VALID ARGUMENTS                                       */   
/* *************************************************************** */   
     USER_ID = USERID()                                                 
/* *************************************************************** */   
     ESP_DSN  =  "'ALSQ"||REG||.||DB||".JCLLIB.ESP2'"                   
     JLIST_DSN = "'"||USER_ID||".ESP2.JOBID.LIST'"                     
     "DEL " ESP_DSN                                                     
     "DEL " JLIST_DSN                                                   
           DRIVER_DSN = "'E33513.ALSQ8.FLAT.FILE'"                     
           ORIGPOS = 1                                                 
/*      ALLOCATE JCL PDS FOR ESP SCHEDULE                      */   
     ADDRESS TSO "ALLOC F(TFIL) DA("ESP_DSN") NEW CATALOG",         
     "UNIT(SYSPX) SPACE(3,2) CYL DIR(30)",                           
     "DSORG(PO) RECFM(F,B) LRECL(80) BLKSIZE(9600)"                 
     "FREE DD(TFIL)"                                                 
/*                                                             */   
     "ALLOC FI(DFILE) DA("DRIVER_DSN") SHR"                         
     "EXECIO * DISKR DFILE (STEM NJOBS. FINIS"                       
     "FREE DDN(DFILE)"                                               
                                                                     
     DO IJOBS = 1 TO NJOBS.0                                         
        RC1 = CHKNSUB(NJOBS.IJOBS REG DB )                           
        IF RC1 <> 0 THEN LEAVE                                       
     END                                                             
     J = 0                                                           
     DO I = 1 TO NJOBS.0                                             
        J = J + 1                                                   
        IF (I = ORIGPOS )  THEN I = ORIGPOS + 1                     
        JLIST.J = SUBSTR(LINE.I,15,8) SUBSTR(LINE.I,24,8) NJOBS.I   
     END                                                             
                                                                       
     "ALLOC FI(JFILE) DSN("JLIST_DSN") RECFM(F)",                       
      "LRECL(80)  BLKSIZE(80) UNIT(SYSPX) SP(50,50) TRACK RELEASE"     
                                                                       
     "EXECIO * DISKW JFILE (STEM JLIST. FINIS"                         
     "FREE DDN(JFILE)"                                                 
     "FREE DDN(QAFIL)"                                                 
     "FREE DDN(TFIL)"                                                   
 MAIN_EXIT:                                                             
     EXIT                                                               
/************************************************************ */       
/* CHKNSUB FUNCTION                                           */       
/************************************************************ */       
 CHKNSUB : PROCEDURE EXPOSE  LINE. IJOBS                               
     PARSE ARG JNAME REG DB                                             
     SAY 'REG2' REG                                                     
     SAY 'DB2'  DB                                                     
                                                                       
     USER_ID = USERID()                                                 
                                                                       
     RC2 = 0                                                         
                                                                     
     QAUTL = "'ALSQ0.UTIL.JCLLIB("JNAME")'"                         
     QADSN = "'ALSQ8.JCLLIB("JNAME")'"                               
     Q0DSN = "'ALSQ0.JCLLIB("JNAME")'"                               
                                                                     
     ESPNAME = DB||REG||SUBSTR(JNAME,3,6)                           
                                                                     
     ESP_MEM = "'ALSQ"||REG||.||DB||".JCLLIB.ESP2("||ESPNAME||")'"   
/********  BUILD JOBID PREFIX  *********************************/   
     QAJOBID = "//"||DB||REG||SUBSTR(JNAME,3,2)                     
/********  ADD JCL FROM ALSQ!.JCLLIB **************************/     
     IF SYSDSN(QADSN) = "OK" THEN DO                                 
        FROMDSN = QADSN                                             
/****** SAY "NOW ADDING FROM: " FROMDSN " QADSN" ***/               
        ADDRESS TSO                                                 
        "ALLOC FI(QAFIL) DA("QADSN") SHR REUSE"                     
        "ALLOC FI(TFIL) DA("ESP_MEM") SHR REUSE"                     
        "REPRO INFILE(QAFIL) OUTFILE(TFIL)"                         
/******* ***********************************/                       
         CALL ESPCALL                                                 
        END                                                           
     ELSE DO                                                           
/********* ADD JCL FROM ALSQ0.JCLLIB    ***********************/       
        IF SYSDSN(Q0DSN) = "OK" THEN DO                               
           FROMDSN = Q0DSN                                             
/********* SAY "NOW ADDING FROM: " Q0DSN  " Q0DSN"  ***********/       
           ADDRESS TSO                                                 
           "ALLOC FI(QAFIL) DA("Q0DSN") SHR REUSE"                     
           "ALLOC FI(TFIL) DA("ESP_MEM") SHR REUSE"                   
           "REPRO INFILE(QAFIL) OUTFILE(TFIL)"                         
/**************   ALSQ0.QA.CLIST(ESPGCALL)*************************/   
/*         ADDRESS ISPEXEC */                                         
/*         "EDIT DATASET("ESP_MEM") ESPCALL " */                       
           CALL ESPCALL                                               
           END                                                         
        ELSE DO                                                       
           SAY "JCL "JNAME "NOWHERE TO BE FOUND "                     
           RC2 = 100                                                   
        END                                                           
     END                                                               
     Y = TIME('E')                                                     
     RETURN RC2                                                         
 /************************ESPCALL********************************/     
ESPCALL:                                                               
 /************************ESPCALL********************************/     
FROMTXT = "'//* SUBMITTED FROM "FROMDSN"'"                             
                                                                       
 ADDRESS ISREDIT                                                       
 "C ALL '?' (DB)"                                                       
 "C ALL '!' (REG)"                                                     
                                                                       
 ADDRESS TSO                                                           
IF REG == "1" THEN                                                     
   DO                                                                   
       ADDRESS ISREDIT                                                 
       "C ALL '$$$$.PROC' 'SMN1.PROC'"                                 
   END                                                                 
IF REG == "2" THEN                                                     
   DO
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 03, 2010 4:27 am
Reply with quote

not really sure what is going on, but:

there is little or no difference between foreground (what you mistakenly call online)
and background - which is batch.

one reason your are receiving an RC20:
when trying to execute an REXX script with ISPF support features (edit, etc...)
is that you don't have all the libraries allocated to the job.
that is why I provided the link.

and what you provided would not work in a foreground session -
you have commented out the invokation of an ISPF EDIT session and the invocation of an edit macro.
the proper syntax is EDIT DA('...') MACRO(edit-macro)
so I don't think your invocation of ESPCALL by a CALL will
in either foreground or background provide an environment whereby you can issue ISPF EDIT Commands like CHANGE, etc...

if you're interested (or need it) here is a starting place to find manuals on:
ISPF
ISPF EDIT MACROs
ISPF SERVICES
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jun 03, 2010 11:37 am
Reply with quote

Take a look at THIS example to hopefully give you a better understanding of the processes involved.
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top