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

Comparision on first 15 char from two files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
atulxp

New User


Joined: 27 Nov 2005
Posts: 15
Location: Phoenix

PostPosted: Sun Mar 18, 2007 6:52 am
Reply with quote

I have two file Old File O & new file N
I need comparision on first 15 char & in output file F unique records from file O & N should be retained however matching records should be taken from file N.

File O
X(15) X(53)
111111111111111 AAAAAA BBBBB AAAAAAA
222222222222222 BBBBBB AAAAA BBBBBBB

File N

222222222222222 AAAAAA BBBBB AAAAAAA
333333333333333 CCCCCC DDDDD CCCCCCC

File F
111111111111111 AAAAAA BBBBB AAAAAAA
222222222222222 AAAAAA BBBBB AAAAAAA
333333333333333 CCCCCC DDDDD CCCCCCC

Please suggest how this could be done via sort
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Mar 18, 2007 7:10 am
Reply with quote

Hello,

Please see the following - this request is asked regularly. Searching the forum would help you also.

Quote:

I suspect you can use some variation of the technique shown in the "Create files with matching and non-matching records" Smart DFSORT Trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/


If after reviewing the material, you have questions, please let us know.
Back to top
View user's profile Send private message
atulxp

New User


Joined: 27 Nov 2005
Posts: 15
Location: Phoenix

PostPosted: Sun Mar 18, 2007 7:50 am
Reply with quote

Hi

I have checked that but that is not resolving my problem fully. Please see problem statement.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sun Mar 18, 2007 10:01 pm
Reply with quote

atulxp,

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed, as shown in your example, that there are no duplicates within file O and no duplicates within file N.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//CON DD DSN=...  input file O
//    DD DSN=...  input file N
//OUT DD DSN=,,,  output file
//TOOLIN   DD    *
SELECT FROM(CON) TO(OUT) ON(1,15,CH) LAST
/*
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top