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 2 files using DFSORT/ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: compare 2 files using DFSORT/ICETOOL
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: 2150
Location: At my coffee table

PostPosted: Sun Mar 28, 2010 7:51 pm    Post subject:
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    Post subject: Reply to: compare 2 files using DFSORT/ICETOOL
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    Post subject:
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

Site Director


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

PostPosted: Mon Mar 29, 2010 12:04 pm    Post subject:
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    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Mar 29, 2010 4:47 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Compare yesterday's date to the one o... migusd SYNCSORT 7 Fri Sep 22, 2017 11:35 pm
No new posts Comparing 2 Files using Current time arunsoods DFSORT/ICETOOL 3 Fri Sep 22, 2017 6:00 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 4 Fri Sep 22, 2017 4:56 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm

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