Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
IEBCOPY - Not replace a existing PDS member and set MAXCC 4

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Aks1988

New User


Joined: 09 Mar 2020
Posts: 3
Location: India

PostPosted: Mon Mar 09, 2020 7:06 pm    Post subject: IEBCOPY - Not replace a existing PDS member and set MAXCC 4
Reply with quote

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
View user's profile Send private message

enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10701
Location: italy

PostPosted: Mon Mar 09, 2020 7:29 pm    Post subject: Reply to: IEBCOPY - Not replace a existing PDS member and set MAXCC 4
Reply with quote

unfortunately not always You able get what You want icon_cool.gif

https://www.ibm.com/support/knowledgecenter/SSLTBW_2.4.0/com.ibm.zos.v2r4.idau100/u1249.htm
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8567
Location: Dubuque, Iowa, USA

PostPosted: Mon Mar 09, 2020 7:38 pm    Post subject: Reply to: IEBCOPY - Not replace a existing PDS member and set MAXCC 4
Reply with quote

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
View user's profile Send private message
Aks1988

New User


Joined: 09 Mar 2020
Posts: 3
Location: India

PostPosted: Mon Mar 09, 2020 7:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10701
Location: italy

PostPosted: Mon Mar 09, 2020 8:05 pm    Post subject: Reply to: IEBCOPY - Not replace a existing PDS member and set MAXCC 4
Reply with quote

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 ? icon_evil.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8567
Location: Dubuque, Iowa, USA

PostPosted: Mon Mar 09, 2020 8:16 pm    Post subject: Reply to: IEBCOPY - Not replace a existing PDS member and set MAXCC 4
Reply with quote

Quote:
I need to get RC = 4 in this case.
You may "need" this, but you cannot do it -- period.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2418
Location: Hampshire, UK

PostPosted: Tue Mar 10, 2020 1:53 am    Post subject: Reply to: IEBCOPY - Not replace a existing PDS member and set MAXCC 4
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 336
Location: Bamberg, Germany

PostPosted: Tue Mar 10, 2020 3:52 am    Post subject:
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 860
Location: The Universe

PostPosted: Tue Mar 10, 2020 6:27 am    Post subject: Re: Reply to: IEBCOPY - Not replace a existing PDS member and set MAXCC 4
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 336
Location: Bamberg, Germany

PostPosted: Tue Mar 10, 2020 10:02 am    Post subject: Re: Reply to: IEBCOPY - Not replace a existing PDS member and set MAXCC 4
Reply with quote

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. icon_neutral.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8567
Location: Dubuque, Iowa, USA

PostPosted: Tue Mar 10, 2020 7:11 pm    Post subject:
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 860
Location: The Universe

PostPosted: Tue Mar 10, 2020 8:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 857
Location: Maryland

PostPosted: Wed Mar 11, 2020 12:05 am    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10701
Location: italy

PostPosted: Wed Mar 11, 2020 12:54 am    Post subject: Reply to: IEBCOPY - Not replace a existing PDS member and set MAXCC 4
Reply with quote

nice lateral thinking !

the suggestion will probably be rejected because certainly the requirement is to do it with just one step icon_cool.gif
Back to top
View user's profile Send private message
Aks1988

New User


Joined: 09 Mar 2020
Posts: 3
Location: India

PostPosted: Thu Mar 12, 2020 12:52 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 857
Location: Maryland

PostPosted: Thu Mar 12, 2020 6:34 pm    Post subject: Re: Reply to: IEBCOPY - Not replace a existing PDS member and set MAXCC 4
Reply with quote

enrico-sorichetti wrote:
nice lateral thinking !

the suggestion will probably be rejected because certainly the requirement is to do it with just one step icon_cool.gif

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Hex Value - vb file replace old date ... premnath DFSORT/ICETOOL 10 Sat Oct 17, 2020 3:15 am
No new posts Determine what library member is in, ... mdwait JCL & VSAM 9 Thu Jul 23, 2020 3:02 am
No new posts IEBCOPY COPYGROUP and EXCLUDE ecsk IBM Tools 6 Thu Jun 04, 2020 10:23 am
No new posts Need to delete inactive records from ... Sanchayita Sinha DB2 5 Fri May 29, 2020 10:47 pm
No new posts Submit Print Job For PDS Member With ... AllenSieracki TSO/ISPF 17 Fri Apr 10, 2020 9:31 pm

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us