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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Paasing symbolic parameter to instrea... Anirudh Anand JCL & VSAM 1 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am


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