Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to change PDS member's name by batch

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rainhear

New User


Joined: 24 May 2005
Posts: 2

PostPosted: Wed Jul 13, 2005 1:08 pm    Post subject: How to change PDS member's name by batch
Reply with quote

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
View user's profile Send private message

parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Wed Jul 13, 2005 4:18 pm    Post subject: Re: How to change PDS member's name by batch
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Wed Jul 13, 2005 4:52 pm    Post subject: Re: How to change PDS member's name by batch
Reply with quote

Quote:
(2)Change the JOBCARD name inside every member also from ABC* to XYZ*. For example,


Check this earlier post....whether it helps......

http://ibmmainframes.com/viewtopic.php?t=2652&highlight=

Regards,

Priyesh.
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Wed Jul 13, 2005 10:43 pm    Post subject: Re: How to change PDS member's name by batch
Reply with quote

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
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Thu Jul 14, 2005 10:10 am    Post subject:
Reply with quote

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? icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts HLIST Utility In Batch Virendra Shambharkar TSO/ISPF 4 Fri Apr 07, 2017 3:38 pm
No new posts Batch job tuning sgandhla Testing & Performance analysis 5 Fri Mar 24, 2017 9:41 pm
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us