IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

ADRDSSU Restore - How to prevent replacing while restore


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Lipi.Prasannan

New User


Joined: 01 Oct 2015
Posts: 10
Location: US

PostPosted: Fri Oct 02, 2015 12:13 am
Reply with quote

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

Senior Moderator


Joined: 14 Mar 2007
Posts: 10714
Location: italy

PostPosted: Fri Oct 02, 2015 12:24 am
Reply with quote

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

New User


Joined: 01 Oct 2015
Posts: 10
Location: US

PostPosted: Fri Oct 02, 2015 12:29 am
Reply with quote

Thanks enrico for your quick response.
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 416
Location: Denmark

PostPosted: Fri Oct 02, 2015 11:57 pm
Reply with quote

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

New User


Joined: 01 Oct 2015
Posts: 10
Location: US

PostPosted: Sat Oct 03, 2015 12:15 am
Reply with quote

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

Global Moderator


Joined: 21 Sep 2010
Posts: 2572
Location: NYC,USA

PostPosted: Sat Oct 03, 2015 12:41 am
Reply with quote

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

New User


Joined: 01 Oct 2015
Posts: 10
Location: US

PostPosted: Sat Oct 03, 2015 2:39 am
Reply with quote

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

New User


Joined: 01 Oct 2015
Posts: 10
Location: US

PostPosted: Sat Oct 03, 2015 2:57 am
Reply with quote

Can anyone please help me with syntax for using COPY RENAME with ADRDSSU?
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10714
Location: italy

PostPosted: Sat Oct 03, 2015 3:15 am
Reply with quote

why not search the forum or better look at the manual Yourself ? icon_evil.gif
Back to top
View user's profile Send private message
Lipi.Prasannan

New User


Joined: 01 Oct 2015
Posts: 10
Location: US

PostPosted: Sat Oct 03, 2015 3:20 am
Reply with quote

Thanks enrico, sorry for asking. icon_neutral.gif
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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Sat Oct 03, 2015 3:46 am
Reply with quote

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

New User


Joined: 01 Oct 2015
Posts: 10
Location: US

PostPosted: Mon Oct 05, 2015 8:46 am
Reply with quote

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

Active User


Joined: 01 Sep 2015
Posts: 416
Location: Denmark

PostPosted: Wed Oct 07, 2015 12:02 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts JCL for replacing code in Cobol JCL & VSAM 7
No new posts Handling abend to prevent termination CICS 0
No new posts special characters pipes "|"... COBOL Programming 1
No new posts adrdssu for copy all data JCL & VSAM 5
No new posts adrdssu tool to dump a files from a PDS JCL & VSAM 5
Search our Forums:

Back to Top