|
View previous topic :: View next topic
|
| Author |
Message |
Deepa_cognizant
New User
Joined: 28 Mar 2010 Posts: 5 Location: chennai
|
|
|
|
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 |
|
 |
CICS Guy
Senior Member

Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
| Back to top |
|
 |
Deepa_cognizant
New User
Joined: 28 Mar 2010 Posts: 5 Location: chennai
|
|
|
|
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 |
|
 |
Deepa_cognizant
New User
Joined: 28 Mar 2010 Posts: 5 Location: chennai
|
|
|
|
| Could anyone repond to my query soon? Thnks for ur help in advance |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Deepa_cognizant
New User
Joined: 28 Mar 2010 Posts: 5 Location: chennai
|
|
|
|
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 |
|
 |
Mazahar
New User

Joined: 11 Dec 2007 Posts: 82 Location: hyderabad
|
|
|
|
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 |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| 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 |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
 |
Deepa_cognizant
New User
Joined: 28 Mar 2010 Posts: 5 Location: chennai
|
|
|
|
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 |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|