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
 

 

Display mismatching fields using SORT/ICETOOL utility
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Fri Sep 11, 2009 12:18 pm    Post subject: Display mismatching fields using SORT/ICETOOL utility
Reply with quote

Hi,

I need to compare two files to create an output file with mismatching fields.

Assume Emp No is the key field.

Output file should contain the key field and mismatching fields.



File1

Emp No Name IBU Proj Code

45832 Yogananda IHLD CISEDS

65123 Rajesh BCMD BOFA

116216 Rohan EUSD BCHN




File2

Emp No Name IBU Proj Code

45832 Yogananda IHLD CISEDS

65123 Rajesh BCMD BOFA

116216 Rohan EUSD SDFV



Output

116216 BCHN SDFV.

How can it be implemented using SORT/ICETOOL utility?


Thanks,
Marina.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Sep 11, 2009 12:42 pm    Post subject:
Reply with quote

OK, the usual questions.

The RECFM & LRECL of both files.
The key position(s), length(s) and format(s) of both files.
Are there duplicate key values in either of the files.
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Fri Sep 11, 2009 1:56 pm    Post subject: RE:DISPALY NON-MATCHING FIELDS USING SORT/ICETOOL UTILITY
Reply with quote

Hi,

RECFM - Sequential file (PS)

It can be VB or FB file.
If input file is FB then it needs to be changed to VB for comparison.
And the record length will also be dynamic. So we need to consider maximum record length.
These depend on the input files which we give and that keeps changing.

Key position, key length also need to be assumed.
In the above scenario assume the key is in 1st position and having key-length 5.

If you could provide a sample script for above requirement it would be helpful?
There will not be any duplicate key values.

Thanks,
Marina.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Sep 11, 2009 3:44 pm    Post subject: Reply to: Display mismatching fields using SORT/ICETOOL util
Reply with quote

do not post the same topic in two different forums please
Back to top
View user's profile Send private message
rockish

Active User


Joined: 05 Jun 2009
Posts: 185
Location: Planet Earth

PostPosted: Fri Sep 11, 2009 3:53 pm    Post subject:
Reply with quote

If a sample script is all that you need, the following might help you,

Assuming the key to be available in the position 1 to 5. And the field which has to be checked if it is updated is available in the position 9 to 12.

Code:
//ICETOOL0 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN1      DD *                                                 
13414AAA1123                                                   
23434BBB3432                                                   
32432CCC3242                                                   
45654DDD5463                                                   
54674EEE3423                                                   
//IN2      DD *                                                 
13414AAA1123                                                   
23434BBB4342                                                   
32432CCC3242                                                   
45654DDD5463                                                   
54674EEE4234                                                   
//OUTPUT   DD SYSOUT=*                                         
//T1       DD DSN=&&T1,DISP=(,PASS),UNIT=TMPDA,SPACE=(TRK,(5,5))
//T2       DD DSN=&&T2,DISP=(,PASS),UNIT=TMPDA,SPACE=(TRK,(5,5))
//CONCT    DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,DELETE)           
//         DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,DELETE)           
//TOOLIN   DD *                                                     
   COPY FROM(IN1) USING(CTL1)                                       
   COPY FROM(IN2) USING(CTL2)                                       
   SPLICE FROM(CONCT) TO(OUTPUT) USING(CTL3) ON(1,9,CH) WITH(14,1) -
   KEEPNODUPS                                                       
//CTL1CNTL DD *                                                     
  OUTFIL FNAMES=T1,BUILD=(1,5,9,4,6,3,C'11')                       
//CTL2CNTL DD *                                                     
  OUTFIL FNAMES=T2,BUILD=(1,5,9,4,6,3,C'22')                       
//CTL3CNTL DD *                                                     
  OUTFIL FNAMES=OUTPUT,INCLUDE=(13,2,ZD,EQ,22),BUILD=(1,5,10,3,6,4)
/*                                                                 




My output was :
Code:

23434BBB4342
54674EEE4234
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Sep 11, 2009 4:20 pm    Post subject:
Reply with quote

Am I correct in thinking that you wish to compare the whole record based on key value.
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Fri Sep 11, 2009 4:25 pm    Post subject:
Reply with quote

Hi Rockish,

Thanks for the sample script.
But the requirement is slightly different . If you loook at the original post there are some fields in the records which needs to be omitted.



Output

116216 BCHN SDFV.


For the above output only the non-matching project codes are displayed along with the key.
Since the employee name and IBU fields are matching we need to delete that.

How do we omit the matching fields?
One more requirement is only key position will be know to me.
The position of the non-matching fields will be unknown.
The non-matching fields need to be retrieved when key is given as input.

Thanks,
Marina.
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Fri Sep 11, 2009 4:28 pm    Post subject:
Reply with quote

Yes expat,

Absolutely right.
The non-matching fields need to be retrieved when key is given as input.
Only the key position and key length is known.
And i need to omit the matching fields.

Thanks,
Marina.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Sep 11, 2009 4:35 pm    Post subject: Reply to: Display mismatching fields using SORT/ICETOOL util
Reply with quote

Quote:
Only the key position and key length is known.

and... just curious how are other processes dealing with such unknown entities icon_eek.gif

Quote:
The position of the non-matching fields will be unknown.


maybe the position of the fields to be matched is not known...
as a char offset/position, but at least at least is the
<word> ( sequence of non blank chars separated by a properly defined separator)
position known
using the above concept the string/word to be matched
Quote:
116216 Rohan EUSD BCHN
would be the 3rd word after the key BCHN

how many records in the files ??
Back to top
View user's profile Send private message
rockish

Active User


Joined: 05 Jun 2009
Posts: 185
Location: Planet Earth

PostPosted: Fri Sep 11, 2009 4:37 pm    Post subject:
Reply with quote

Oops.. After reading EXPAT's reply and the first post, now i feel like, for every matching keys, field by field comparison is required and the required output should have both the old and new values for the changed fields..

I think its better if Marina can clarify more about fields to be matched..
Back to top
View user's profile Send private message
rockish

Active User


Joined: 05 Jun 2009
Posts: 185
Location: Planet Earth

PostPosted: Fri Sep 11, 2009 4:39 pm    Post subject:
Reply with quote

OMG.. By the time i fixed my internet problem and posted my reply, three new replies already !!! Sorry for the out of sync post icon_neutral.gif
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Fri Sep 11, 2009 4:42 pm    Post subject:
Reply with quote

All fields need to be compared baesd on the key field.
Key fields will be same in both the files. (For the time being forget about inserted and deleted records).

Compare all the fields based on the key and retrieve only the non-matching fields(not the entire non-matching record).
The matching fields should not get displayed.

As i mentioned before file format (FB or VB) and LRECL are all dynamic.
These depend on the user.

I hope this clarifies.

Thanks,
Marina.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Sep 11, 2009 4:44 pm    Post subject: Reply to: Display mismatching fields using SORT/ICETOOL util
Reply with quote

Quote:
I hope this clarifies.

NO
please answer what I asked in my previous post
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Fri Sep 11, 2009 4:47 pm    Post subject:
Reply with quote

I am sorry,
But i dont get your question?

Could you please elaborate the same?
Back to top
View user's profile Send private message
rockish

Active User


Joined: 05 Jun 2009
Posts: 185
Location: Planet Earth

PostPosted: Fri Sep 11, 2009 5:00 pm    Post subject:
Reply with quote

Now let me summarise what I have understood !!!

There are two input files with unique keys. Apart from the key, the length of the remaining fields in both the files are unknown. (Hence the LRECL of the file is unknown as well).
Now the requirement is to match the records with the same key from both files and display all the fields that have unmatched values.
I have to agree that, this is beyond my capability as of now. So I am going to turn into a silent observer for this post from now on and let the experts do the rest of talking.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Sep 11, 2009 5:06 pm    Post subject: Reply to: Display mismatching fields using SORT/ICETOOL util
Reply with quote

ok let' s put the question in a different way...
you talk about a key and we came up with...
the key position 1 length 5 ( the sample record key is 6 but let' s forget abou it )

the you talk about fileds, by visual inspection can be evinced that for the record I used as a sample
the fields are Rohan, EUSD, BCHN

but in IT the subroutine/class parse_based_on_visual_inspection is not yet available
( rumors tell that it will be available on the second release of OS/VU )

so please,please define an algorithm by which we can extract fields

my previous post proposed one...
field = sequence of chars separated by blanks
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Fri Sep 11, 2009 5:06 pm    Post subject:
Reply with quote

It can be done only using COBOL.

As you do not know the position of the non-matching fields.

So you will have to search with the key.

Once you find a matching record with same key in the 2nd file, compare byte by byte the rest of the data.

When you find a non-matching field retrieve using the COPYBOOK.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Sep 11, 2009 5:12 pm    Post subject: Reply to: Display mismatching fields using SORT/ICETOOL util
Reply with quote

the issue is shifting towards pure sillyness

Quote:
It can be done only using COBOL.

what algorithm logic are You going to use to identify each field

if You told that we might give better answers
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Fri Sep 11, 2009 5:15 pm    Post subject:
Reply with quote

I am thinking,
If u have any suggestions please do so.

Thanks,
Marina.
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Fri Sep 11, 2009 5:18 pm    Post subject:
Reply with quote

I was on the right track initially, was thinking of doing it in COBOL.
Then somebody suggested DFSORT/ICETOOL utility.
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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