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

compare two files with different format using ICETOOl


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

New User


Joined: 13 Feb 2010
Posts: 3
Location: Calcutta

PostPosted: Tue May 03, 2011 11:35 am
Reply with quote

I have two files having LRECL=232 and FB

First file has the structure

USERID(1 to 7 position) ex :a111111,a111112 etc
Space ( 8th position)
SYSTEMCODE (9 to 11 position) ex: AB*


a111111 AB1
a111111 AB4
a111111 AB7
a111112 AB1
a111112 AB2
a111112 AB3
a111112 AB4
a111113 AB2
a111113 AB3


Second File has the structure

USERID(1 to 7 position)
Space ( 8th position)
SYSTEMCODE 1 (9 to 11 position)
Space ( 12th position)
SYSTEMCODE 2 (13 to 15 position)
Space ( 14th position)
-
-
-
_____UPTO system code 9 is possible----



a111111 AB1 AB4 AB7
a111112 AB1 AB3 AB4 AB2
a111112 AB2 AB3

The system codes in second file is not in sorted order so in the second record the sequence is 1,3,4,2
instead of 1,2,3,4

But The system codes in first file is sorted


the data in the above two files are the same but in different format.
We need to compare two files to ensure the data are the same.

So to validate above two files using ICETOOL or DFSORT , I reuire first file to be formatted as

a111111 AB1 AB4 AB7
a111112 AB1 AB2 AB3 AB4
a111113 AB2 AB3

and the second file to be formatted as the same as first file

a111111 AB1 AB4 AB7
a111112 AB1 AB2 AB3 AB4
a111113 AB2 AB3

Please let me know if it is can be done using ICETOOL
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 03, 2011 4:29 pm
Reply with quote

Quote:

So to validate above two files using ICETOOL or DFSORT , I reuire first file to be formatted as

a111111 AB1 AB4 AB7
a111112 AB1 AB2 AB3 AB4
a111113 AB2 AB3

and the second file to be formatted as the same as first file

a111111 AB1 AB4 AB7
a111112 AB1 AB2 AB3 AB4
a111113 AB2 AB3

Please let me know if it is can be done using ICETOOL

Yes definitely this can be done. but after doing that how do you validate? are you going to manually validate the files?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 03, 2011 4:39 pm
Reply with quote

Also second input file data you have shown is
Code:

a111111 AB1 AB4 AB7
a111112 AB1 AB3 AB4 AB2
a111112 AB2 AB3

But I believe you mean..
Code:

a111111 AB1 AB4 AB7
a111112 AB1 AB3 AB4 AB2
a111113 AB2 AB3

Please confirm...
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 03, 2011 5:21 pm
Reply with quote

Below steps will give you what you wanted...

If data in both input files is same then final output file will be empty.
If data is present only in first file then that will appear in final output file with value 1 at 23rd position
If data is present only in second file then that will appear in final output file with value 2 at 23rd position....

Code:

//STEP0100 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SORTIN   DD *                               
A111111 AB1 AB4 AB7                           
A111112 AB1 AB3 AB4 AB2                       
A111113 AB2 AB3 AB4                           
//SORTOUT  DD DSN=&&TEMP,DISP=(NEW,PASS)     
//SYSIN    DD *                               
  OPTION COPY                                 
  OUTFIL BUILD=(1,8,9,3,/,                   
                1,8,13,3,/,                   
                1,8,17,3,/,                   
                1,8,21,3,/,                   
                1,8,25,3,/,                   
                1,8,29,3,/,                   
                1,8,33,3,/,                   
                1,8,37,3,/,                     
                1,8,41,3)                     
/*                                           
//STEP0200 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//FIRST    DD *                                 
A111111 AB1                                     
A111111 AB4                                     
A111111 AB7                                     
A111112 AB1                                     
A111112 AB2                                     
A111112 AB3                                     
A111112 AB4                                     
A111113 AB2                                     
A111113 AB3                                     
A111113 AB6                                     
//SECOND   DD DSN=&&TEMP,DISP=(MOD,PASS)         
//JNF2CNTL DD *                                 
  OMIT COND=(9,3,CH,EQ,C' ')                   
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                 
  OPTION COPY                                   
  JOINKEYS F1=FIRST,FIELDS=(1,11,A)             
  JOINKEYS F2=SECOND,FIELDS=(1,11,A),SORTED 
  JOIN UNPAIRED,ONLY                   
  REFORMAT FIELDS=(F1:1,11,F2:1,11,?)   
/*                                     


Output in this case will be...
Code:

           A111113 AB42   
A111113 AB6           1   
Back to top
View user's profile Send private message
Lopamudra Mukherjee

New User


Joined: 13 Feb 2010
Posts: 3
Location: Calcutta

PostPosted: Wed May 04, 2011 4:25 pm
Reply with quote

Thanks a lot for your help . But JOINKEYS are not supported in my my version of DFSORT . The Job giving RC 16 with following messages

Messages ******

ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 03:49
OPTION COPY
JOINKEYS F1=FIRST,FIELDS=(1,11,A)
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY

Messages ******
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed May 04, 2011 6:56 pm
Reply with quote

Does it satisfy your requirement atleast?


Refer ibmmainframes.com/viewtopic.php?t=33389 and let us know your ptf level or post your complete ICE201I message...
Back to top
View user's profile Send private message
Lopamudra Mukherjee

New User


Joined: 13 Feb 2010
Posts: 3
Location: Calcutta

PostPosted: Thu May 05, 2011 6:17 pm
Reply with quote

yes... it does...
I can modify and customize it according to my need afterwards.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu May 05, 2011 6:18 pm
Reply with quote

Lopamudra Mukherjee wrote:
yes... it does...
I can modify and customize it according to my need afterwards.


Sambhaji wrote:
Refer ibmmainframes.com/viewtopic.php?t=33389 and let us know your ptf level or post your complete ICE201I message...

You haven't answered my second request.....
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 Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top