View previous topic :: View next topic
|
Author |
Message |
ankoo
New User
Joined: 12 Jun 2010 Posts: 31 Location: India
|
|
|
|
Is it possible to Replace a mem of a PDS1 with another member of PDS2 with the same name?If yes , then by using which utility? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
IEBCOPY, IEBGENER, and it is all documented in the utilities manual.
Click the button "IBM Manuals" found at the top of almost every page, and have a good peruse. |
|
Back to top |
|
|
ankoo
New User
Joined: 12 Jun 2010 Posts: 31 Location: India
|
|
|
|
I have understood that it can be done, also it is written that we have to use the replace (R) option on an INDD or COPY statement. but no example is provided. Can anyone please provide an example how to use R option on COPY statement......... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Code: |
COPY OUTDD=SYSUT2,INDD=((SYSUT1,R)) |
SYSUT1 and SYSUT2 can be any names you wish to use -- as long as the JCL matches.
Why are you not looking such a simple thing up in the manual yourself? The manual can be reached on the manuals link at the top of this page. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Ah, Robert, the OP has categorically stated that no example exists. However, I like yourself had obviously at some time in the past read the manual thoroughly and adopted that fast dying technique
TRIAL AND ERROR
TBH, not sure if I could have worked it out myself from here though
Quote: |
INDD=[(]{DDname|(DDname,R)}[,...][)]
specifies the names of DD statements that locate the input data sets.
When an INDD= appears in a record by itself (that is, not with a COPY keyword), it functions as a control statement and begins a new step in the current COPY operation.
These values can be coded:
DDname
the ddname of the DD statement for the input data set. For an unload operation, only one ddname should be specified per COPY statement. If more than one ddname is specified for a copy or load operation, the input data sets are processed in the same sequence as the ddnames are specified.
R
specifies that all members to be copied or loaded from this input data set are to replace any identically named members on the output partitioned data set. (In addition, members whose names are not on the output data set are copied or loaded as usual.) When this option is specified, the ddname and the R parameter must be enclosed in a set of parentheses; if it is specified with the first ddname in INDD, the entire field, exclusive of the INDD parameter, must be enclosed in a second set of parentheses. |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
Back to top |
|
|
ankoo
New User
Joined: 12 Jun 2010 Posts: 31 Location: India
|
|
|
|
I the second link provided above an example is given in which select member is having two commas " SELECT MEMBER=((B,,R),A) ) " inside, I am copyng the JCL below.Please let me know if anyone got to know.......
//COPY JOB ...
//JOBSTEP EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=A
//OUT1 DD DSNAME=DATASET1,UNIT=disk,VOL=SER=111112,
// DISP=(OLD,KEEP)
//IN6 DD DSNAME=DATASET6,UNIT=disk,VOL=SER=111115,
// DISP=OLD
//IN5 DD DSNAME=DATASET5,UNIT=disk,VOL=SER=111116,
// DISP=(OLD,KEEP)
//SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSIN DD *
COPYOPER COPY OUTDD=OUT1
INDD=IN5,IN6
SELECT MEMBER=((B,,R),A) |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Show us the JCL and control statements that you have created and let us know where you are getting problems, posting output to show these errors. |
|
Back to top |
|
|
ankoo
New User
Joined: 12 Jun 2010 Posts: 31 Location: India
|
|
|
|
Following is the JCL I am using
//IEBCPY1 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//DD1 DD DISP=SHR,DSN=PWSX.R9SSHC6.MYALLOC8
//*THIS JOB REPLACES THE MEMBER CONTENTS OF OUTPUT FILE WITH
//*THE MEMBER CONTENTS OF INPUT FILE
//DD2 DD DSN=PWSX.R9SSHC6.EDT235,DISP=MOD
//* DISP=(NEW,CATLG,DELETE),
//* DCB=(RECFM=FB,LRECL=200,BLKSIZE=26000,DSORG=PO)
//SYSIN DD *
COPY INDD=DD1,OUTDD=DD2
SELECT MEMBER=((JCL,R))
//* COPY INDD=((DD1,R)),OUTDD=DD2
//* SELECT MEMBER=((B,,R),A)
/*
// |
|
Back to top |
|
|
ankoo
New User
Joined: 12 Jun 2010 Posts: 31 Location: India
|
|
|
|
Following is the error I am getting in spool
IEBCOPY MESSAGES AND CONTROL STATEMENTS
IEBCOPY FMID HDZ1A10 SERVICE LEVEL UA46465 DATED 20090319 DFSMS 01.1
R9SSHC6G IEBCPY1 08:58:49 WED 01 SEP 2010 PARM=''
COPY INDD=DD1,OUTDD=DD2
SELECT MEMBER=(JCL,R)
COPYING FROM PDS INDD=DD1 VOL=CPX956 DSN=PWSX.R9SSHC6.MYALLOC8
TO PDS OUTDD=DD2 VOL=CPX940 DSN=PWSX.R9SSHC6.EDT235
NO MEMBERS COPIED FROM INPUT DATA SET REFERENCED BY DD1
R WAS SELECTED BUT NOT FOUND IN ANY INPUT DATA SET
THERE ARE 0 UNUSED TRACKS IN OUTPUT DATA SET REFERENCED BY DD2
JOB HAS TERMINATED WITH ERROR(S)
END OF JOB - 4 WAS HIGHEST SEVERITY CODE |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Take a look at the syntax given to you by Robert.
Then use a simple SELECT MEMBER= card like
or use the format of SELECT card that you are currently using, BUT, read the manual very carefully regarding syntax when using REPLACE on a SELECT statement. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
There are none so blind as those who WILL NOT see (or read posts and ignore what is posted). |
|
Back to top |
|
|
ankoo
New User
Joined: 12 Jun 2010 Posts: 31 Location: India
|
|
|
|
Ok now I know what it does and how to do it
Actually "SELECT MEMBER=((INPUT,JCL,R))" select statement will copy the contents of INPUT member of PDS1 and put in the member JCL of PDS2, even if the JCL is already present in PDS2, it will just overrite the contents of the member JCL, and if a new member name is given example JCL2(in second parameter of select statement) then it will create a new member JCL1 and put contents of INPUT to the JCL1.......
Thanks guys :-) |
|
Back to top |
|
|
ankoo
New User
Joined: 12 Jun 2010 Posts: 31 Location: India
|
|
|
|
Another think which I would like to add here is that if we write
"SELECT MEMBER=((JCL,JCL,R))" statement it will give MAXCC=4 and the updated member JCL (first parameter in select) form input PDS will not be copied to output JCL member of PDS2
Any idea how to do it will be greatly appreciated...... |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
the correct syntax for copying and replacing an existing member using your code is
Code: |
SELECT MEMBER=((JCL,,R)) |
Also the other issue you are having is you cannot use MOD for a PDS.
Gerry |
|
Back to top |
|
|
ankoo
New User
Joined: 12 Jun 2010 Posts: 31 Location: India
|
|
|
|
If i write the above select statement then the JCL member form PDS1 will be copied to the R member in PDS2, what actually I want is that yhe JCL member from PDS1 should be copied to JCL member in PDS2..... |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
did you try the code I provided ?
Gerry |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
ankoo wrote: |
If i write the above select statement then the JCL member form PDS1 will be copied to the R member in PDS2, what actually I want is that yhe JCL member from PDS1 should be copied to JCL member in PDS2..... |
Please explain the rationale behind this comment. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Please explain the rationale behind this comment. |
I believe that all this says is that when an incorrect control statement is submitted, incorrct results occur. . . |
|
Back to top |
|
|
|