|
View previous topic :: View next topic
|
| Author |
Message |
atanwc
New User
Joined: 26 Jul 2006 Posts: 24
|
|
|
|
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 |
|
 |
Aaru
Senior Member

Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
 |
atanwc
New User
Joined: 26 Jul 2006 Posts: 24
|
|
|
|
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 |
|
 |
Aaru
Senior Member

Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
 |
skkp2006
New User

Joined: 14 Jul 2006 Posts: 93 Location: Chennai,India
|
|
|
|
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 |
|
 |
Aaru
Senior Member

Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
 |
atanwc
New User
Joined: 26 Jul 2006 Posts: 24
|
|
|
|
| Thanks! I will try this next week |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|