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

Copy data from one file depending on conditions


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

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

Manikandan,

Download sorttrck.pdf from the following link -

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
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
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: 1436
Location: Bangalore,India

PostPosted: Tue Jun 19, 2007 10:24 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top