|
View previous topic :: View next topic
|
| Author |
Message |
remya nair
New User
Joined: 18 Jan 2006 Posts: 5
|
|
|
|
hi,
can any body tell me is there any utility in jcl to rename all the members of a PDS(not the PDS name) |
|
| Back to top |
|
 |
Hanfur
Active User

Joined: 21 Jun 2006 Posts: 104
|
|
|
|
try using utkities IEBCOPY or IEHPROGM as given below..
//TAAXXX JOB (XX,TEST),'HAN TEST.',
// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=X
//SYSUT3 DD UNIT=3390,SPACE=(TRK,(5))
//SYSUT4 DD UNIT=3390,SPACE=(TRK,(5))
//IN1 DD DSN=XXXX.XXXX.TS.XXXX,DISP=OLD
//OUT DD DSN=XXXX.XXX.TD.XXXX,DISP=SHR
//SYSIN DD *
COPY INDD=IN1,OUTDD=OUT
SELECT MEMBER=((MEM1,SEM1,R))
/*
//
Here MEM1 would be renamed to SEM1..
Also can use IEHPROGM utlity
//STEP1 EXEC PGM=IEHPROGM
//SYSPRINT DD SYSOUT=*
//DISK DD UNIT=3390,VOL=SER=PRNA2F,DISP=OLD
//SYSIN DD *
RENAME DSNAME=XXXXX.XXX.TS.XXX,VOL=SER=PRNA2F, C
MEMBER=MEM1,NEWNAME=NEWA
/*
//
You can also go with Fileaid options for achvieng the same..
-Han. |
|
| Back to top |
|
 |
remya nair
New User
Joined: 18 Jan 2006 Posts: 5
|
|
|
|
hi,
i have 1 more doubt
if i have 10 members in a pds, and i want to rename all the 10 .
is there anything which i helps to make it possible that with 1 single command, such that i can give that command and the name of members which is to be changed and the new member name? |
|
| Back to top |
|
 |
saithvis2
New User

Joined: 23 Dec 2005 Posts: 61 Location: Providence , US
|
|
|
|
Hi Remya,
For doing the same , list down all the member names in a flat file using IEHLIST , and their corresponding renamed names in a diff flat file .
repeat the above IEBCOPY jcl using REXX and you have a job for the same .
If you want i will code the same .  |
|
| Back to top |
|
 |
remya nair
New User
Joined: 18 Jan 2006 Posts: 5
|
|
|
|
hi friend,
i dont have any idea abt REXX, so what to do? |
|
| Back to top |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
| remya nair wrote: |
hi friend,
i dont have any idea abt REXX, so what to do? |
Use something else (COBOL, Assembler, CLIST, PL/I, etc.). |
|
| Back to top |
|
 |
Nithinra
New User
Joined: 03 Jul 2006 Posts: 11
|
|
|
|
Hi ,
I think you can do it with IEBCOPY
//STEP1 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=A
//INOUT DD DSN=A.B.C,DISP=OLD
//SYSIN DD *
COPY INDD = INOUT,OUTDD=INOUT
SELECT MEMBER=((MEM1,NEWNAME,R),MEM2,NEWNAME2,R))
/*
This will work.
Regards,
Nithin |
|
| Back to top |
|
 |
saithvis2
New User

Joined: 23 Dec 2005 Posts: 61 Location: Providence , US
|
|
|
|
Hi all,
Please try out the same .
| Code: |
//STEP001 EXEC PGM=IEHLIST
//SYSPRINT DD DSN=your.flat.file.temp,DISP=(OLD,KEEP,KEEP)
//DD1 DD UNIT=3390,VOL=SER=Y2VL32,DISP=OLD
//SYSIN DD *
LISTPDS DSNAME=your.pds.to.be.renamed,VOL=3390=Y2VL32
/*
//*
//STEP02 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=YOUR.FLAT.FILE.TEMP
//SORTOUT DD DSN=&&TEMP2,DISP=(,PASS,KEEP),SPACE=(CYL,(10,10),RLSE)
//SORTWK1 DD SPACE=(CYL,(100,10),RLSE)
//SORTWK2 DD SPACE=(CYL,(100,10),RLSE)
//SORTWK3 DD SPACE=(CYL,(100,10),RLSE)
//SORTWK4 DD SPACE=(CYL,(100,10),RLSE)
//SORTWK5 DD SPACE=(CYL,(100,10),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(12,8)
OMIT COND=(12,8,EQ,C' '),FORMAT=SS
/*
//STEP03 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=&&TEMP2,DISP=(OLD,DELETE,DELETE)
//SORTOUT DD DSN=YOUR.FLAT.FILE,DISP=(OLD,KEEP,KEEP)
//SYSIN DD *
SORT FIELDS=COPY,
SKIPREC=1
/*
//*
|
Now , all your pds members will be available at your flat file .
you must be having a list of new member names , put them in a diff flat file i.e. your.flat.file1 .
now , run the below given rexx .
| Code: |
/* REXX */
"ALLOC DA('YOUR.FLAT.FILE') FI(TLIST) SHR REUSE"
"ALLOC DA('YOUR.FLAT.FILE1') FI(TLIST1) SHR REUSE"
"ALLOC DA('YOUR.JCL') FI(OUTPUT) SHR REUSE"
"EXECIO * DISKR TLIST (STEM PROG. FINIS"
"EXECIO * DISKR TLIST1 (STEM PROG1. FINIS"
"FREE FI(TLIST)"
"FREE FI(TLIST1)"
J = 1
CALL GENERATE_JOBCARD
CALL GENERATE_JCL_MAIN
DO I = 1 TO PROG.0
PROG = SUBSTR(PROG.I,12,8)
CALL GENERATE_JCL_MEMBERS
END
CALL GENERATE_JCL_LEFTOVER
"EXECIO * DISKW OUTPUT (FINIS STEM FILE."
"FREE FI(OUTPUT)"
EXIT
GENERATE_JOBCARD:
FILE.J = "//ABCDTEMP JOB (1,1111111),TEST,REGION=4M,PRTY=1,CLASS=L,"
J = J + 1
FILE.J = "// MSGCLASS=M,MSGLEVEL=(1,1),USER=&SYSUID "
J = J + 1
FILE.J = "/*ROUTE PRINT LOCAL "
J = J + 1
FILE.J = "/*JOBPARM ROOM=111"
J = J + 1
RETURN
GENERATE_JCL_MAIN:
FILE.J = "//STEP1 EXEC PGM=IEBCOPY "
J = J + 1
FILE.J = "//SYSPRINT DD SYSOUT=A "
J = J + 1
FILE.J = "//INOUT DD DSN=A.B.C,DISP=OLD "
J = J + 1
FILE.J = "//SYSIN DD * "
J = J + 1
FILE.J = "COPY INDD = INOUT,OUTDD=INOUT "
J = J + 1
RETURN
GENERATE_JCL_MEMBERS:
FILE.J = " SELECT MEMBER=("||PROG||","||PROG1||",R) "
J = J + 1
RETURN
GENERATE_JCL_LEFTOVER:
FILE.J = "/* "
J = J + 1
RETURN
.
|
After running this rexx , you will have a jcl ready in your PS ,
YOUR.JCL. Submit the jcl for changing the member names .
Hope it helps.
Do let me know if there are any issues in running the same.
regards
Vishal |
|
| Back to top |
|
 |
Hanfur
Active User

Joined: 21 Jun 2006 Posts: 104
|
|
|
|
Saith,
Don't you think for this prog to work ;the variable PROG1 also needs to be populated before issuing a call to the Routine GENERATE_JCL_MEMBERS as given below ?
DO I = 1 TO PROG.0
PROG = SUBSTR(PROG.I,12,8)
PROG1 = SUBSTR(PROG1.I,12,8)
CALL GENERATE_JCL_MEMBERS
END
-Han. |
|
| Back to top |
|
 |
saithvis2
New User

Joined: 23 Dec 2005 Posts: 61 Location: Providence , US
|
|
|
|
Hi Hanfur,
Please have refer my quote .
| Quote: |
Now , all your pds members will be available at your flat file .
you must be having a list of new member names , put them in a diff flat file i.e. your.flat.file1 .
|
Actually you should have a list of members to be renamed in a different flat file . Which , you can populate using the iehlist job (if they are available in a particular pds )and adding one more rexx statement as you did , or else by populating your.flat.file1 from wherever the list is available with the user. It depends on where is the list of new member names .
Thus , i have not elaborated much about the same .
Please correct me if wrong .
regards,
Vishal |
|
| Back to top |
|
 |
saithvis2
New User

Joined: 23 Dec 2005 Posts: 61 Location: Providence , US
|
|
|
|
Hi Han,
Yeah inadvertently.. i missed out on the addition of prog1 in the rexx.
| Code: |
PROG1 = SUBSTR(PROG1.I,12,8)
|
or
| Code: |
| PROG1 = SUBSTR(PROG1.I,1,8) |
If the flat file names in your.flat.file1 is starting from 1 st column.
And yeah your.flat.file1 needs to be populated by any means which ever suits the programmer.
Thanks for rectifying me on the same.
Regards,
Vishal |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|