|
View previous topic :: View next topic
|
| Author |
Message |
rainhear
New User
Joined: 24 May 2005 Posts: 2
|
|
|
|
Hi dear friends,suppose there are 100 members in a JCL library.All the member's name start with ABC*.I need do following process,
(1)Change all the 100 members' name from ABC* to XYZ*.
(2)Change the JOBCARD name inside every member also from ABC* to XYZ*. For example,
original:
//ABC12345 JOB 'ACCOUNT',MSGCLASS=X,CLASS=0
want to change to:
//XYZ12345 JOB 'ACCOUNT',MSGCLASS=X,CLASS=0
Manually change them one by one is very time consuming.Could anybody tell me a better method to change them all by batch?
Thank a lot for your help. |
|
| Back to top |
|
 |
parikshit123
Active User
.jpg)
Joined: 01 Jul 2005 Posts: 269 Location: India
|
|
|
|
Hi,
I am not much aware of any inbuilt utility on mainframes to do this.
Its quite possible that there will be some.
But, given this problem I would like to attack it in following manner.
Optimizations are really welcome.
1. write a COBOL program to update the JCL dataset . It should be easy if the JCLs require very structured changed ( much like you have asked for).
Note that JCL source code are written into sequential (ESDS) files having 80 bytes length FB.
2. Then write a JCL to run this program and providing DSNs for all your JCLs in seperate steps executing the same program ( as mentioned in point 1)
Here, you may like to write a COBOL program to write the JCL for point 2 using a COBOL program itself.
Its a bit complex solution but coudn't find any other.
if there are hundreds of JCLs in your JCL library and the changes to be made are structured and well defined one, then the above approach may be feasible.
Otherwise, manual changes is the last option.
As I said earlier, there may be better ways to do that.
further posts are welcome and curiously waited for. |
|
| Back to top |
|
 |
priyesh.agrawal
Senior Member

Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
| Back to top |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Will this work for you?
| Code: |
//*
//STEP0001 EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=original source JCL library
//SYSUT2 DD DSN=&&JCLSEQ,
// DISP=(,PASS),UNIT=VIO
//SYSIN DD *
PUNCH TYPORG=PO
/*
//*
//STEP0002 EXEC PGM=SORT
//SORTIN DD DSN=&&JCLSEQ,DISP=(OLD,PASS)
//T1 DD DSN=&&T1,DISP=(,PASS),UNIT=VIO,RECFM=FB
//T2 DD DSN=&&T2,DISP=(,PASS),UNIT=VIO,RECFM=FB
//T3 DD DSN=&&T3,DISP=(,PASS),UNIT=VIO,RECFM=FB
//T4 DD DSN=&&T4,DISP=(,PASS),UNIT=VIO,RECFM=FB
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
* ADD SEQUENCE NUMBER TO RECORDS TO KEEP IN THE PROPER ORDER
INREC FIELDS=(2,80,81:SEQNUM,8,ZD)
* BUILD AN IEBUPDTE HEADER WITH NEW MEMBER NAME
OUTFIL FNAMES=T1,
INCLUDE=(1,11,CH,EQ,C'MEMBER NAME',AND,14,3,CH,EQ,C'ABC'),
OUTREC=(1:C'./ ADD NAME=XYZ',17,5,81:81,8)
* BUILD AN IEBUPDTE HEADER WITH EXISTING MEMBER NAME
OUTFIL FNAMES=T2,
INCLUDE=(1,11,CH,EQ,C'MEMBER NAME',AND,14,3,CH,NE,C'ABC'),
OUTREC=(1:C'./ ADD NAME=',14,8,81:81,8)
* CHANGE EXISTING JOBCARD FROM //ABC TO //XYZ
OUTFIL FNAMES=T3,INCLUDE=(1,5,CH,EQ,C'//ABC',AND,
12,3,CH,EQ,C'JOB'),
OUTREC=(1:C'//XYZ',6:6,74,81:81,8)
* SAVE ALL THE REST OF THE RECORDS
OUTFIL FNAMES=T4,SAVE
/*
//*
//STEP0003 EXEC PGM=SORT
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)
// DD DSN=&&T2,DISP=(OLD,PASS)
// DD DSN=&&T3,DISP=(OLD,PASS)
// DD DSN=&&T4,DISP=(OLD,PASS)
//SORTOUT DD DSN=&&COMB,DISP=(,PASS),UNIT=VIO
//SYSOUT DD SYSOUT=*
//SYSIN DD *
* COMBINE ALL WORK FILES IN THE ORIGINAL ORDER
SORT FIELDS=(81,8,ZD,A)
OUTREC FIELDS=(1:1,80)
/*
//*
//STEP0004 EXEC PGM=IEBUPDTE,PARM=NEW
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DSN=new JCL source library,
// DISP=(,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(10,10,500),RLSE),
// RECFM=FB,LRECL=80
//SYSIN DD DSN=&&COMB,DISP=(OLD,PASS)
//*
|
|
|
| Back to top |
|
 |
parikshit123
Active User
.jpg)
Joined: 01 Jul 2005 Posts: 269 Location: India
|
|
|
|
suprek, Priyesh,
Nice answers.
I will try this today itself.
Rainhear, instead of my solution ( which is tedius to implement).
the solutions mentioned above seems to be more feasible.
Any way, why to reinvent the wheel?  |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|