Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Compare Files using ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
atchuta konduri

New User


Joined: 25 Oct 2007
Posts: 16
Location: mumbai

PostPosted: Tue Sep 23, 2008 5:30 pm    Post subject: Compare Files using ICETOOL
Reply with quote

Hi,

I have two files FileA & FileB
FileA
======
789111567
111888991
330007845

FileB
======
789111567
311888991
330007845

I need to create two files
FileC containing matched records and FileD containing unmatched records
FileC
======
789111567
330007845

FileD
======
111888991
311888991

I tried using ICETOOL with following syntax in TOOLIN
SELECT FROM(BKIN) TO(DUP) DISCARD(NODUP) -
ON(1,9,ZD) ALLDUPS

//BKIN FILEA,DISP=SHR
FILEB,DISP=SHR

//DUP FILEC,DISP=(NEW,CATLG,DELETE)

//NODUP FILED,DISP=(NEW,CATLG,DELETE)

FILED is getting generated properly but FileC contains duplicate records


FileD
======
111888991
311888991

FileC
=====
330007845
330007845
789111567
789111567

Does it mean I have to sort FileC again in the next step or is it possible in the same step.
Can someone advise on the correct syntax?


Thanks in advance.

Atchuta
Back to top
View user's profile Send private message

hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Tue Sep 23, 2008 6:34 pm    Post subject:
Reply with quote

You can add additional statment in splice to copy from NODUP and write in to your final output (i.e final file with duplicates).

During this copy you can eliminate duplicates using SUM FIELDS=NONE.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Sep 23, 2008 9:56 pm    Post subject:
Reply with quote

Atchuta,

You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input files have RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//FILEA DD DSN=FILEA,DISP=SHR (FB/80)
//FILEB DD DSN=FILEB,DISP=SHR (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//FILEC DD DSN=FILEC,DISP=(NEW,CATLG,DELETE)   (FB/80)
//FILED DD DSN=FILED,DISP=(NEW,CATLG,DELETE)   (FB/80)
//TOOLIN DD *
COPY FROM(FILEA) TO(T1) USING(CTL1)
COPY FROM(FILEB) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(FILEC) ON(1,9,ZD) KEEPNODUPS -
  WITH(81,1) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=FILEC,INCLUDE=(81,2,CH,EQ,C'VB'),
    BUILD=(1,80)
  OUTFIL FNAMES=FILED,SAVE,
    BUILD=(1,80)
/*
Back to top
View user's profile Send private message
atchuta konduri

New User


Joined: 25 Oct 2007
Posts: 16
Location: mumbai

PostPosted: Wed Sep 24, 2008 3:55 pm    Post subject: Thank you
Reply with quote

Thank you Frank, it worked perfectly
Back to top
View user's profile Send private message
atchuta konduri

New User


Joined: 25 Oct 2007
Posts: 16
Location: mumbai

PostPosted: Mon Oct 13, 2008 3:46 pm    Post subject: Facing a small problem
Reply with quote

Hi,

As mentioned in the earlier post we have two files. above resolution given by frank is working perfectly but i have a small problem here.

FileA
======
789111567
111888991
330007845

FileB
======
789111567
311888991
330007845

but fileA contains data in hex format (S9(09) USAGE COMP).
FileB --- Picture clause defined as 9(09).

Is there any way to compare these two files? or Do i need to convert any of these file format before icetool step?


Thanks in advance.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Oct 13, 2008 8:48 pm    Post subject:
Reply with quote

9(9) is a 9-byte ZD field.

S9(9) COMP is a 4-byte BI field (assuming its unsigned like the 9(9) field).

If you want to compare these two fields, you must convert one of them first. You could use a DFSORT/ICETOOL job like this. However, your output files could have a mixture of the records with the ZD fields and the records with the BI fields. I'm not sure if that's what you want. If not, you need to explain what you do want for output.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//FILEA DD DSN=...  input fileA (FB/80) - ZD field
//FILEB DD DSN=...  input fileB (FB/80) - BI field
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//FILEC DD DSN=...  output fileC (FB/80)
//FILED DD DSN=...  output fileD (FB/80)
//TOOLIN DD *
COPY FROM(FILEA) TO(T1) USING(CTL1)
COPY FROM(FILEB) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(FILEC) ON(83,4,BI) KEEPNODUPS -
  WITH(81,1) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'BB',83:1,9,ZD,TO=BI,LENGTH=4)
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'VV',83:1,4)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=FILEC,INCLUDE=(81,2,CH,EQ,C'VB'),
    BUILD=(1,80)
/*
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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us