View previous topic :: View next topic
|
Author |
Message |
jpdeshai
New User
Joined: 24 Jun 2007 Posts: 57 Location: US
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
What is Sync? Is it supposed to be Syncsort? |
|
Back to top |
|
|
jpdeshai
New User
Joined: 24 Jun 2007 Posts: 57 Location: US
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
jpdeshai
New User
Joined: 24 Jun 2007 Posts: 57 Location: US
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|