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
 

 

Copy data from one file depending on conditions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
manikandanjs

New User


Joined: 02 Jun 2006
Posts: 27
Location: Blue Bell, PA

PostPosted: Fri Jun 15, 2007 1:20 pm    Post subject: Copy data from one file depending on conditions
Reply with quote

I have two files (file1) of length 100 and another file (file2). If the first seven bytes of the file1 is equal to the first seven byte of the file2, I need to copy the fields from position 10 to 16 of file2 into file1 (at the end). So the output file will have a length of 107 bytes.

Thanks,
Manikandan J
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Jun 15, 2007 2:14 pm    Post subject:
Reply with quote

Manikandan,

Download sorttrck.pdf from the following link -

http://www-304.ibm.com/jct01004c/systems/support/storage/software/sort/mvs/tricks/index.html

The topic Join fields from two files on a key in the pdf helps you to acheive your requirment.
Back to top
View user's profile Send private message
manikandanjs

New User


Joined: 02 Jun 2006
Posts: 27
Location: Blue Bell, PA

PostPosted: Fri Jun 15, 2007 5:13 pm    Post subject:
Reply with quote

I'm able to do that successfully when file1 doesn't have any duplicate keys.

But it needs to be performed for the duplicate records as well.

Thanks,
Manikandan J
Back to top
View user's profile Send private message
manikandanjs

New User


Joined: 02 Jun 2006
Posts: 27
Location: Blue Bell, PA

PostPosted: Tue Jun 19, 2007 10:20 am    Post subject:
Reply with quote

Hi,

Could anybody know how to perform the above operation in ICETOOL or DFSORT if the file is having duplicate keys?

I'm not able to do for the duplicate key using ICETOOL (using SPLICE technique).

Thanks,
Manikandan J
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Jun 19, 2007 10:24 am    Post subject:
Reply with quote

Manikandan,

Add WITHALL to the SPLICE statement -

Code:
SPLICE FROM(TMP1) TO(OUT) ON(1,3,CH) WITHALL WITH(11,5)
Back to top
View user's profile Send private message
manikandanjs

New User


Joined: 02 Jun 2006
Posts: 27
Location: Blue Bell, PA

PostPosted: Tue Jun 19, 2007 11:24 am    Post subject:
Reply with quote

Thanks Murali, the output is coming correctly. icon_smile.gif
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am


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