View previous topic :: View next topic
|
Author |
Message |
Aks1988
New User
Joined: 09 Mar 2020 Posts: 3 Location: India
|
|
|
|
Hi,
I have below requirement-
I need to copy 'n' number of members from input PDS to output PDS.
If any of the member is replaced, job should end with RC=4.
The PDS members may vary and output PDS name also varies.
I am able to copy and not replace the members but not able to set the required return code.
//STEP1 EXEC PGM=IEBCOPY,REGION=4M
//OUT DD DISP=SHR,DSN=INput.PROCLIB
//IN DD DISP=SHR,DSN=Output.PROCLIB
.
.
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY INDD=IN,OUTDD=OUT
SELECT MEMBER=AAA
SELECT MEMBER=BBB
Thanks,
Aks |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
You do not get to pick and choose the return code you get. From the manual these are the IEBCOPY return codes:
Quote: |
00 (X'00') Successful completion.
04 (X'04') One or more copy group operations ended unsuccessfully or were incompletely performed. Recovery may be possible.
08 (X'08') An unrecoverable error exists. The utility ends. |
If you want any other return code -- for any reason whatsoever -- then either you do NOT use IEBCOPY, or you adjust your "requirement" to not need a return code set. |
|
Back to top |
|
|
Aks1988
New User
Joined: 09 Mar 2020 Posts: 3 Location: India
|
|
|
|
I already checked the link but was not of much help.
If the members are already there in output dataset, they are simply not replaced and the job ends with RC=0. I need to get RC = 4 in this case. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
I need to get RC = 4 in this case. |
why it is so difficult for You to understand that You cannot get what You want ? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
I need to get RC = 4 in this case. |
You may "need" this, but you cannot do it -- period. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Write the IEBCOPy output to a dataset and then process it through a program that will parse the IEBCOPY output looking for relevant messages and have that program issue the relevant return code. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1334 Location: Bamberg, Germany
|
|
|
|
IEBCOPY as written by TS does not specify replace. So basically it will fail on dups or X37. One should not call that stable conditions to filter reliably for a return code. I would agree on what Nic has suggested. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Robert Sample wrote: |
You do not get to pick and choose the return code you get. From the manual these are the IEBCOPY return codes:
Quote: |
00 (X'00') Successful completion.
04 (X'04') One or more copy group operations ended unsuccessfully or were incompletely performed. Recovery may be possible.
08 (X'08') An unrecoverable error exists. The utility ends. |
|
You (or more likely) one of your systems guys, might open a problem with IBM. If it failed to replace a member, then a copy operation was incompletely performed and IEBCOPY should end with RC = 4. Before you start this make 100% certain you are not running any of the IEBCOPY replacements - something called PDSFAST rings in my memory, and CA has one that actually impressed me (and I'm hard to impress). Obviously if you're running a replacement, you open the problem with the replacement's vendor.
Now I'm not promising IBM will actually fix the problem. They may call it a documentation error and alter the manual |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1334 Location: Bamberg, Germany
|
|
|
|
steve-myers wrote: |
Now I'm not promising IBM will actually fix the problem. They may call it a documentation error and alter the manual |
That sounds familiar to me. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
If it failed to replace a member, then a copy operation was incompletely performed and IEBCOPY should end with RC = 4. |
Look at the original post. The REPLACE option was NOT specified and hence IEBCOPY should not have replaced the member. The copy operation was performed as requested by the TS with the expected results. A return code of 4 would not be expected given the job stream. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
OK. I think I see your argument; since replace was not explicitly specified it's OK that it didn't replace the member, hence RC = 0.
Then the only practical solution is to scan the IEBCOPY output. That shouldn't be hard. For example -
Code: |
MACRO
&NAME NEWSAVE &ADDR
&NAME LR 15,13 COPY SAVE AREA ADDRESS TO REG 15
AIF ('&ADDR' EQ '').STACK
LA 13,&ADDR COMPUTE NEW SAVE AREA ADDRESS
AGO .CHAIN
.STACK LA 13,72(,13) COMPUTE NEW SAVE AREA ADDRESS
.CHAIN ST 13,8(,15) ADD NEW SAVE AREA TO THE
ST 15,4(,13) SAVE AREA CHAIN
MEND
TSTCOPY CSECT
USING *,12
SAVE (14,12),,TSTCOPY-&SYSDATE-&SYSTIME
LR 12,15
NEWSAVE SAVEAREA
OPEN (INPUT,INPUT,OUTPUT,OUTPUT)
LTR 15,15
BZ SCAN
MVI RC,8
B EXIT
SCAN GET INPUT
LR 2,1
PUT OUTPUT,(2)
CLC =C'IEB1067I',1(2)
BNE SCAN
MVI RC,4
B SCAN
EOF DC 0H'0'
EXIT CLOSE (INPUT,,OUTPUT)
L 13,4(,13)
SR 15,15
IC 15,RC
RETURN (14,12),RC=(15)
INPUT DCB DSORG=PS,MACRF=GL,DDNAME=INPUT,EODAD=EOF
OUTPUT DCB DSORG=PS,MACRF=PM,DDNAME=OUTPUT,RECFM=FBA,LRECL=121
RC DC FL1'0'
SAVEAREA DC 9D'0'
LTORG
END TSTCOPY |
Of course you can use any language you like. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2140 Location: USA
|
|
|
|
z/OS DFSMSdfp Utilities - SC23-6864-00 wrote: |
RC4NOREP
Use of this parameter will cause IEBCOPY to set a return code of X'04'
when a module is not copied from the source data set to the target data set
because REPLACE was not specified. When 'RC4NOREP' is specified,
message IEB1067W will be issued for each module NOT copied due to the
REPLACE option not being specified. Note: Message IEB1067W will be
issued regardless of the LIST option requested. |
You can run IEBCOPY with no Replace in INDD parameter, + RC4NOREP parameter, and analyze if RC=4?
Then you can run IEBCOPY with Replace in INDD parameter, to actually copy both duplicated, and non-duplicated names. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
nice lateral thinking !
the suggestion will probably be rejected because certainly the requirement is to do it with just one step |
|
Back to top |
|
|
Aks1988
New User
Joined: 09 Mar 2020 Posts: 3 Location: India
|
|
|
|
It seems it could not be done as such. I posted this query to see if I am not missing anything and get expert advice.
Thanks!
I think I have to see some alternatives for this. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2140 Location: USA
|
|
|
|
enrico-sorichetti wrote: |
nice lateral thinking !
the suggestion will probably be rejected because certainly the requirement is to do it with just one step |
Any recommendation to satisfy this "requirement" in pseudo-one-step via parsing the original IEBCOPY log (especially those involving ASM code) are much more lateral... |
|
Back to top |
|
|
|