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

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Thu Jan 22, 2009 1:08 am
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
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

Global Moderator


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

PostPosted: Thu Jan 22, 2009 2:41 am
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: 1702
Location: Australia

PostPosted: Thu Jan 22, 2009 2:49 am
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
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

Moderator Emeritus


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

PostPosted: Fri Jan 23, 2009 3:58 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
Search our Forums:

Back to Top