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

how to globally change pds members prefix names


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
atanwc

New User


Joined: 26 Jul 2006
Posts: 24

PostPosted: Fri Jul 06, 2007 7:07 am
Reply with quote

hi! I need some help!

I want to create a job (JCL) to copy 100 PDS members into a temp PDS daily and then rename the prefix of the 100 members in the temp PDS.

For Example:
PDS 1
PDS.AAAA.member(XXmem1, XXmem2......XXmem100)

Copy to

PDS 2
PDS.BBB.member(YYmem1, YYmem2....YYmem100)

I know I can use IEBCOPY to copy 100 members from PDS.AAA.member to PDS.BBB.member. But how to globally change all prefix from XX to YY for all 100 members? So it will be XXmem1 to YYmem1...and so on.

Please help!
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jul 06, 2007 8:37 am
Reply with quote

You can do this using REXX.

-Read all the members of the PDS in a stem variable
-Read one member at a time and copy it to a diff PDS with a new member name
- Keep repeating this till the last member
Back to top
View user's profile Send private message
atanwc

New User


Joined: 26 Jul 2006
Posts: 24

PostPosted: Fri Jul 06, 2007 9:13 am
Reply with quote

Thanks! Is there anyway can use sort, copy or JCL utilities? Because I do not see any REXX in our shop.

Thanks!
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jul 06, 2007 9:33 am
Reply with quote

There are several ways to do the renames. U can either use
IEHPROGM, IDCAMS or IKJEFT01 in batch.

continuation X shd be in the 72nd column

//RENAME JOB...
//STEP1 EXEC PGM=IEHPROGM
//SYSPRINT DD SYSOUT=*
//DD1 DD UNIT=SYSDA,VOL=SER=USER01,DISP=SHR
//SYSIN DD *
RENAME DSNAME=ABC.DEF.GHI, X
VOL=SYSDA=USER01, X
MEMBER=MEMBER,NEWNAME=NEW
/*
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Fri Jul 06, 2007 11:01 am
Reply with quote

i tried this with the below control statement .... but its giving error that
"REQUIRED VOLUME COULD NOT BE MOUNTED ... UNUSUAL END"


Code:
//SYSIN DD *
  RENAME DSNAME=TEST.SYAM.JOBSNAP,VOL=SER=D21219,                      X
               NEWNAME=TEST.SYAM.JOBSNAP1
/*



Code:
  RENAME DSNAME=TEST.SYAM.JOBSNAP,VOL=SER=D21219,                      X
               NEWNAME=TEST.SYAM.JOBSNAP1
 IEH210I  YOUR REQUEST CANNOT BE SERVICED....
 IEH211I  REQUIRED VOLUME COULD NOT BE MOUNTED  ... UNUSUAL END



how to resolve this ?????
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jul 06, 2007 11:22 am
Reply with quote

my last post was to rename a member in a PDS. but i guess u have tried renaming the whole PDS and that might be the problem.


One more thing u have given the wrong volume serial no. Just do a 3.4 and get the volume serial no and then use it in the JCL.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Fri Jul 06, 2007 6:40 pm
Reply with quote

Here's another possible option:

Code:

//STEP1    EXEC PGM=IKJEFT01                           
//SYSTSPRT DD   DSN=&&SYSTSPRT,DISP=(,PASS),           
//         UNIT=VIO,SPACE=(CYL,(1,1))                 
//SYSTSIN  DD   *                                     
LISTDS 'AAA.MEMBER' MEMBERS                           
/*                                                     
//*                                                 
//STEP2    EXEC PGM=ICEMAN                           
//SORTIN   DD   DSN=&&SYSTSPRT,DISP=(OLD,PASS)       
//SORTOUT  DD   DSN=&&SORTOUT,DISP=(,PASS),         
//         UNIT=VIO,SPACE=(CYL,(1,1))               
//SYSOUT   DD   SYSOUT=*                             
//SYSIN    DD   *                                   
  OPTION COPY                                       
  OUTFIL STARTREC=9,CONVERT,INCLUDE=(5,3,CH,EQ,C' '),
    BUILD=(2X,C'SELECT MEMBER=(',                   
      8,8,SQZ=(SHIFT=LEFT,LEAD=C'(',TRAIL=C','),     
      C'YY',10,6,SQZ=(SHIFT=LEFT,TRAIL=C'))'),80:X) 
/*                                                   
//*                                                           
//STEP3    EXEC PGM=IEBCOPY                                   
//PDSI     DD   DISP=SHR,DSN=AAA.MEMBER                       
//PDSO     DD   DISP=SHR,DSN=BBB.MEMBER                       
//SYSPRINT DD   SYSOUT=*                                       
//SYSIN    DD   *                                             
  COPY INDD=((PDSI,R)),OUTDD=PDSO                             
/*                                                             
//         DD   DSN=&&SORTOUT,DISP=(OLD,PASS)                 
//*                                                           
Back to top
View user's profile Send private message
atanwc

New User


Joined: 26 Jul 2006
Posts: 24

PostPosted: Sat Jul 07, 2007 6:03 am
Reply with quote

Thanks! I will try this next week
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts SELECT from data change table DB2 5
No new posts Trying to change copybook in online c... CICS 4
Search our Forums:

Back to Top