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

compare 2 files using DFSORT/ICETOOL


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

New User


Joined: 28 Mar 2010
Posts: 5
Location: chennai

PostPosted: Sun Mar 28, 2010 3:48 pm
Reply with quote

Hi,
I need to compare two files of length 971 with the values in same position (say 15 to 47). The records in the files are as follows.

INPUT FILE 1
AA 12345 DEEPA NO4 SCHEME ROAD
BB 24356 VINU 11 NEW HOUSING BOARD UNIT
CC 43255 DIVYA 43-2 SECOND STREET
DD 46776 RAMESH 8-MOUNT ROAD

INPUT FILE 2
DIVYA
DEEPA

i need the output file with 971 LREC as below:
AA 12345 DEEPA NO4 SCHEME ROAD
CC 43255 DIVYA 43-2 SECOND STREET
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sun Mar 28, 2010 7:51 pm
Reply with quote

As Dick would say, welcome to the forum....

Did you look at a sort manual?
Did you do any sort of search of this forum?
Try starting with the create file from other 2 files matich key value thread.....
Back to top
View user's profile Send private message
Deepa_cognizant

New User


Joined: 28 Mar 2010
Posts: 5
Location: chennai

PostPosted: Mon Mar 29, 2010 10:43 am
Reply with quote

Input File 1: This has the LREC – 971, record format – FB.

Input File 2: This has the LREC – 971, record format – FB.

Output File: I need the details of the employees mentioned in file 2 from file1. (match the keys from position 15-47)

Please have a look on the attachment and send me a sort JCL so that i could receive the output file as required.

Attachment deleted
Back to top
View user's profile Send private message
Deepa_cognizant

New User


Joined: 28 Mar 2010
Posts: 5
Location: chennai

PostPosted: Mon Mar 29, 2010 11:44 am
Reply with quote

Could anyone repond to my query soon? Thnks for ur help in advance
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: Mon Mar 29, 2010 12:04 pm
Reply with quote

Hello and welcome to the forum,

Well, you're not off to a very good start. . .

For one thing, many of our contributors cannot download attachments. The machine i'm using tonight has no MS-Office products installed, so i can't see your attahcment. It is best to use copy/paste (and the "Code" tag for things that need to preserve slignment) to post information you want people to use to help you.

You were given a suggestion on where to look to work on your request. Did you look there? Did you use the info presented there? If not, why not? You didn't mention if that was or was not what you are looking for.

It is very bad manners to pester for replies when you only wait 1 hour.

Your posted data does not match the "rules" you posted. If you re-post properly, there may be more useful replies. . .
Back to top
View user's profile Send private message
Deepa_cognizant

New User


Joined: 28 Mar 2010
Posts: 5
Location: chennai

PostPosted: Mon Mar 29, 2010 1:36 pm
Reply with quote

Yes Dick, I am searching for a sort manual. I have two files FileA & FileB.


File A - This has the LREC – 971, record format – FB. I need to match the values in position 15-47 with the records in file B

020500200742008-11-012008-10-2712383288ALEXANDRA CLASEN
020500200752008-10-302008-10-2712410188JEANNE SCHIPPER-JOBE
020500200782008-10-012008-10-2712450273JOAN WACHA
020500200792008-11-012008-10-2712471335KATE DOOM
020500200802008-11-012008-10-2712474542JACQUELINE CLASEN
020500200812008-11-012008-10-2712503386KELLY LEHN
020500200812009-07-012009-05-2812194291KELLY LEHN
020500200832008-10-272008-10-2712520912ALAN PLANTIKOW
020500200842008-11-012008-10-2712525319LESLIE BUTTS
020500200852008-10-012008-10-2712552525MARTY MANDEL
. . . .
. . . .
. . . .



File B This has the LREC – 971, record format – FB. same position as in file A (15-47)
00200752008-10-302008-10-27124101
00200812008-11-012008-10-27125033
00200912008-10-222008-10-27130116
00201072008-11-012008-10-27140930
00201102008-10-212008-10-27141452



For eg: if the details are available in File A for the record '00200752008-10-302008-10-27124101' [KEY -> 15-33] then the whole record needs to be
fetched from File A and should get write to output fileC as available in File A.

File C:

020500200752008-10-302008-10-2712410188JEANNE SCHIPPER-JOBE
020500200812008-11-012008-10-2712503386KELLY LEHN

The requirement is - i need details for those available in file B.


I tried using ICETOOL with following syntax in TOOLIN

//IN1 DD DSN=SS5342.G5342.B05T.REM01,DISP=SHR
//IN2 DD DSN=SS5342.G5342.INPUT.DDS.DF2,DISP=SHR
//T1 DD DSN=&&T1,SPACE=(CYL,(5,5),RLSE),DISP=(MOD,PASS)
//OUT1 DD DSN=SS5342.G5342.OUTC.TRIAL1,
// DISP=(NEW,CATLG),
// UNIT=PFED1,
// SPACE=(CYL,(150,25),RLSE),
// DCB=(DPH.MODEL,RECFM=FB,LRECL=971,BLKSIZE=27188,DSORG=PS)
//FILEA DD DSN=SS5342.G5342.OUTC.TRAIL2,
// DISP=(NEW,CATLG),
// UNIT=PFED1,
// SPACE=(CYL,(150,25),RLSE),
// DCB=(DPH.MODEL,RECFM=FB,LRECL=971,BLKSIZE=27188,DSORG=PS)
//FILEB DD DSN=SS5342.G5342.OUTC.TRAIL3,
// DISP=(NEW,CATLG),
// UNIT=PFED1,
// SPACE=(CYL,(150,25),RLSE),
// DCB=(DPH.MODEL,RECFM=FB,LRECL=971,BLKSIZE=27188,DSORG=PS)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(15,33,ZD) WITH(34,1) KEEPNODUPS USING(CTL3)
/*
//CTL1CNTL DD *
SORT FIELDS=(15,33,CH,A)
OUTREC FIELDS=(15,33,971:C'11')
//CTL2CNTL DD *
SORT FIELDS=(15,33,CH,A)
OUTREC FIELDS=(15,33,971:C'22')
//CTL3CNTL DD *
OUTFIL FNAMES=OUT1,INCLUDE=(971,2,CH,EQ,C'12'),OUTREC=(15,33)
OUTFIL FNAMES=FILEA,INCLUDE=(971,2,CH,EQ,C'11'),OUTREC=(15,33)
OUTFIL FNAMES=FILEB,INCLUDE=(971,2,CH,EQ,C'22'),OUTREC=(15,33)
/*


Can someone advise on the correct syntax?
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Mon Mar 29, 2010 4:32 pm
Reply with quote

Deepa,

Try this. I am assuming 15-47 means 15 to 47 chars (total 33 bytes to be compared)

Code:
//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DISP=SHR,DSN=<INPUT1>
//IN2 DD DISP=SHR,DSN=<INPUT2>
//T1 DD DSN=&&T1,
//     SPACE=(CYL,(5,5),RLSE),DISP=(MOD,PASS)
//OUT1 DD DSN=<OUTPUT DS1>,
//              DISP=(NEW,CATLG),
//              DCB=*.IN1
//OUT2 DD DSN=<OUTPUT DS2>,
//              DISP=(NEW,CATLG),
//              DCB=*.IN1
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT1) ON(15,33,CH)  KEEPBASE KEEPNODUPS -
      VLENOVLY WITHALL WITH(1,1) WITH(3,971) USING(CTL3)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,BUILD=(C'BB',3:1,971)
//CTL2CNTL DD *
  INREC BUILD=(C'VV',3:1,971)
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT1,INCLUDE=(1,2,CH,EQ,C'VB'),
         BUILD=(3,971)
  OUTFIL FNAMES=OUT2,INCLUDE=(1,2,CH,EQ,C'VV'),
        BUILD=(3,971)
/*
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 29, 2010 4:47 pm
Reply with quote

Deepa_cognizant wrote:
Could anyone repond to my query soon? Thnks for ur help in advance
Did you look at the thread pointed to by CICS Guy?
Deepa_cognizant wrote:
Can someone advise on the correct syntax?
Why don't you post the actual syntax error?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Mar 29, 2010 10:57 pm
Reply with quote

Deepa_cognizant,

Assuming your input files do NOT have duplicates on the key. The following DFSORT/ICETOOL job will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                     
//TOOLMSG  DD SYSOUT=*                           
//DFSMSG   DD SYSOUT=*                           
//IN       DD DSN=Your input file A,DISP=SHR               
//         DD DSN=Your input file B,DISP=SHR               
//OUT      DD SYSOUT=*                           
//TOOLIN   DD    *                               
  SELECT FROM(IN) TO(OUT) ON(15,33,CH) FIRSTDUP 
//*
Back to top
View user's profile Send private message
Deepa_cognizant

New User


Joined: 28 Mar 2010
Posts: 5
Location: chennai

PostPosted: Tue Mar 30, 2010 1:12 pm
Reply with quote

I had asked for correct syntax bcoz i got the MAX 12 error message on executing my job. please refer the err description.

Code:
            SPLICE FROM(T1) TO(OUT) ON(15,33,CH) WITH(902,1)                   
ICE627I 0 DFSORT CALL 0003 FOR SORT FROM T1       TO OUT      COMPLETED         
ICE628I 0 RECORD COUNT:  000000000045461                                       
ICE638I 0 NUMBER OF RECORDS RESULTING FROM CRITERIA:  000000000005052           
ICE602I 0 OPERATION RETURN CODE:  00                                           
                                                                               
                          KEEPNODUPS USING(CTL3)                               
                          $                                                     
ICE614A 0 INVALID OPERATOR                                                     
ICE602I 0 OPERATION RETURN CODE:  12                                           
                                                                               
                                                                               
ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE:  12                   

I had run the below code and got the expected result.

Code:
//IN1       DD DSN=INPUT FILE1,
//             DISP=SHR                                               
//          DD DSN=INPUT FILE2,     
//             DISP=SHR                                               
//OUT1      DD DSN=OUTPUT TRIALA2,
//         DISP=(NEW,CATLG),                                           
//         UNIT=PFED1,                                                 
//         SPACE=(CYL,(150,25),RLSE),                                 
//         DCB=(DPH.MODEL,RECFM=FB,LRECL=971,BLKSIZE=27188,DSORG=PS)   
//TOOLIN    DD *                                                       
 SELECT FROM(IN1) TO(OUT1) ON(15,33,CH) FIRSTDUP                       
//* 


Thanks to all
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Mar 30, 2010 10:18 pm
Reply with quote

Deepa_cognizant,

The error you are getting is because you did not have a continuation parm on your splice statement. However at this point it is useless as you have a working solution with less number of passes.
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(F1 & F2) and writ... JCL & VSAM 8
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
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
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top