Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us