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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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