Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Read, Select & Copy .. How to do using IBM tools or Sync

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

New User


Joined: 24 Jun 2007
Posts: 57
Location: US

PostPosted: Thu Jan 22, 2009 12:51 am    Post subject: Read, Select & Copy .. How to do using IBM tools or Sync
Reply with quote

Hi,

My Requirement is:
File 1 has all the Members names
ex:
ABCD1
ABCD2
HDGJ4
IUYUI8

PDS1 has these members and some other Members also.
I need to copy only the Members in the file1 to PDS2.

It should be like,
- Read input file
- Check if it is present in the PDS1,
- If it is present copy to PDS2.
- If it is not present leave it.

Any help is appriciated.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Jan 22, 2009 1:08 am    Post subject: Reply to: Read, Select & Copy .. How to do using IBM too
Reply with quote

What is Sync? Is it supposed to be Syncsort?
Back to top
View user's profile Send private message
jpdeshai

New User


Joined: 24 Jun 2007
Posts: 57
Location: US

PostPosted: Thu Jan 22, 2009 1:13 am    Post subject:
Reply with quote

Sorry, it was Syncsort.
I mean, I can use IBM tools, or we have Syncsort on our system.

we need to do this using them.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Jan 22, 2009 2:41 am    Post subject: Reply to: Read, Select & Copy .. How to do using IBM too
Reply with quote

If you were to combine the contents of the member names from FILE1 with the contents of the member listing from PDS1, then you would have a dataset containing members in both, and members just in PDS1 that aren't listed in FILE1. If you use SYNCTOOL to select only those entries with a duplicate name, then those are the members to be copied.

For example, the combined list could look like:

Code:

ABCD1
ABCD2
HDGJ4
IUYUI8
ABCD1
ABCD2
XXXXXX
ZZZZZZ


where only the members ABCD1 and ABCD2 appear in both files, so those would be the only members to be copied.

I don't have SYNCSORT/SYNCTOOL, but the DFSORT/ICETOOL command would be:
Code:

SELECT FROM(IN) TO(OUT) ON(1,8,CH) FIRSTDUP USING(CTL1)


and CTL1CNTL would build the IEBCOPY SELECT statements:
Code:

  OUTFIL FNAMES=OUT,OUTREC=(3:C'SELECT MEMBER=',1,8,80:X)


Then, all you need to do is run IEBCOPY to copy the selected members from PDS1 to PDS2.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jan 22, 2009 2:49 am    Post subject:
Reply with quote

Hi,

is there any reason to test if members exist in PDS1, just generate the IEBCOPY statements from file1 and run the job.

If member does not exist in PDS1 when copying to PDS2, you will just get a warning IEB177I ABCD1 WAS SELECTED BUT NOT FOUND IN ANY INPUT DATA SET


Gerry
Back to top
View user's profile Send private message
jpdeshai

New User


Joined: 24 Jun 2007
Posts: 57
Location: US

PostPosted: Fri Jan 23, 2009 3:48 am    Post subject:
Reply with quote

Hi Kevin,

Not sure if I have confused with my rqrmts, But,it should be like,
the File1 has only the Names of the Members to be selected from PDS1 and copy to a PDS2.

So the there are 3 things, File1, PDS1 & PDS2.

Thanks,
JP
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jan 23, 2009 3:58 am    Post subject:
Reply with quote

Hello,

Quote:
Not sure if I have confused with my rqrmts,
Your requirements were understood.

Please review what Kevin posted - it will do what you want.

You might also consider the suggestion from Gerry - it would allow you to not be concerned if the member was in pds1 - just try to copy it and if it does not exist, that particular copy would do nothing.

Suggest you try the suggestions and post back here if there are any problems.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us