View previous topic :: View next topic
|
Author |
Message |
Lipi.Prasannan
New User
Joined: 01 Oct 2015 Posts: 10 Location: US
|
|
|
|
Hello everyone,
Request your expert advise on below -
I am using ADRDSSU to dump a set of PDS and transmitting the dumped file to another Mainframe region and there I am restoring the dataset to get all the dumped PDSs. Below is the code for restore -
//JS010 EXEC PGM=ADRDSSU,
// REGION=0M
//SYSPRINT DD SYSOUT=*
//RESTORE DD DSN=HLQ.COMPRESS.DATASET,
// DISP=SHR,
// UNIT=SYSDA
//OUTVOL1 DD DISP=SHR,
// UNIT=SYSDA,
// VOL=REF=*.RESTORE
//SYSIN DD *
RESTORE DATASET(INCLUDE(HLQ.COPY1.D.ADC1 -
HLQ.COPY2.D.EDEV -
HLQ.COPY3.D.PDEV)) -
INDD(RESTORE) TOL(ENQF) -
OUTDDNAME( -
OUTVOL1 -
) -
REPLACE -
SPHERE -
SHARE
//*
Each time the job run, the dataset(PDS) restored can be any one of the three HLQ.**.D.**.
Requirement - If the PDS is already present, I want the members in restored PDS to be appended to existing same PDS.
Eg: Dataset HLQ.COMPRESS.DATASET has PDS HLQ.COPY1.D.ADC1 dumped in it and this PDS has Member 1, Member 2.
The PDS HLQ.COPY1.D.ADC1 is already catalogued and present with Member4, Member 5. When I execute this restore I want all members (Member1, Member2, Mender4, Member5) to be present in PDS. When I tested above becuase of the REPLACE the PDS is getting replaced, I am missing Member 4, Member5 which was already present.
Can anyone please help me with this.
Please let me know if you need any more information.
Thanks! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
If the PDS is already present, I want the members in restored PDS to be appended to existing same PDS. |
Unfortunately what You ask for is IMPOSSIBLE to achieve
ADRDSSU works at the dataset level, knows nothing about its content. |
|
Back to top |
|
|
Lipi.Prasannan
New User
Joined: 01 Oct 2015 Posts: 10 Location: US
|
|
|
|
Thanks enrico for your quick response. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
However as you are copying just a couple of discrete pds, it would not be too much of an effort to do something like this:
1. restore to another name using the RENAMEUNC(hlq) operand
2. allocate pds if not present:
//C1 EXEC IDCAMS
//SYSPRINT DD DUMMY
LISTCAT ENT(target.dataset.name)
// IF C1.RC NE 0 THEN
//C2 EXEC PGM=IEFBR14
//DD1 allocate target.dataset.name
//ENDIF
3. copy noreplace
//C3 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//ID DD DSN=restored.dataset.name
//OD DD DSN=target.dataset.name
COPY IN=ID,OUT=OD I am a little hazy about the syntax here
With no replacee option existing members are preserved. |
|
Back to top |
|
|
Lipi.Prasannan
New User
Joined: 01 Oct 2015 Posts: 10 Location: US
|
|
|
|
Thanks Willy for your response.
Problem with my requirement is HLQ.COPY1.D.ADC1 is actually like this HLQ.**.D.ADC1 and can be any of 100s of PDS. So the allocation and copy process will not be possible. I was looking for any wild card copy functionality so that I can copy the restored PDS to a bkup PDS which will not be replace but appended.
Appreciate any comments/suggestions.
Thanks! |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
LP,
Why don't you use a temporary dataset and then concatenate both (old and temp) to get what you need. Just another step. If I understood you correctly. |
|
Back to top |
|
|
Lipi.Prasannan
New User
Joined: 01 Oct 2015 Posts: 10 Location: US
|
|
|
|
Thanks Rohit for your comment. I dont think concatenation will work for my requirement as I am not sure which PDS needs to be copied. |
|
Back to top |
|
|
Lipi.Prasannan
New User
Joined: 01 Oct 2015 Posts: 10 Location: US
|
|
|
|
Can anyone please help me with syntax for using COPY RENAME with ADRDSSU? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
why not search the forum or better look at the manual Yourself ? |
|
Back to top |
|
|
Lipi.Prasannan
New User
Joined: 01 Oct 2015 Posts: 10 Location: US
|
|
|
|
Thanks enrico, sorry for asking.
I had few try's as per manuals and other posts, it did not work, so thought it will be great to get any new suggestions. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
I'm looking at the z/OS 1.13 manual and RENAME is not listed as a COPY option -- only RENAMEUNCONDITIONAL. RESTORE has a RENAME option, but not COPY. |
|
Back to top |
|
|
Lipi.Prasannan
New User
Joined: 01 Oct 2015 Posts: 10 Location: US
|
|
|
|
Thanks RObert for your response, am checking on other options. I don't thing ADRDSSU will work for my requirement.
Thanks all for reviewing my query and providing valuable comments. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
RENAMEUNC works fine for COPY. As I remember RESTORE ... RENAME (I always use RENAMEUNC) then the rename is only done if the dataset already exists - which of course it does for a COPY. |
|
Back to top |
|
|
|