View previous topic :: View next topic
|
Author |
Message |
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
I have to compare two files based on SSN. I want the first file contents to o/p files if the SSN is matched with II file.
I file: Recfm: 1061
II file: Recfm: 126
And the difficulty thing is in first file the SSN is defined as PIC S9(09) COMP and in II file SSN is defined as PIC 9(9).
I know how to do if they are of same format.
Code: |
//T1 DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN2) USING(CTL1)
COPY FROM(IN1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,9,CH) WITHALL WITH(01,1061) USING(CTL3)
//CTL1CNTL DD *
OUTFIL FNAMES=T1,OVERLAY=(1062:1,9)
//CTL2CNTL DD *
OUTFIL FNAMES=T1,OVERLAY=(1062:9X)
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,BUILD=(01,1061),
INCLUDE=(1,9,CH,EQ,1062,9,CH)
/*
|
R KARTHIK |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
I forgot to mention the key field position,
In I file (1,4) --- PIC S9(09) COMP
In II file (1,9) --- PIC 9(09).
Regards
R KARTHIK |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Karthik,
If I remember correctly you had SyncSort. Has your shop migrated to DFSORT ? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
Quote: |
files based on SSN. |
Just out of curiosity, please let me know what does SSN refer to here? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
Most likely Social Security Number. . . |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi Dick,
dick scherrer wrote: |
Most likely Social Security Number. . . |
as He said:
Quote: |
SSN is defined as PIC S9(09) COMP |
so I doubt this. . . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
Quote: |
Quote: |
SSN is defined as PIC S9(09) COMP |
so I doubt this. . . |
What doubt might this cause?
Lots of old systems defined social number as 9(9) comp or 9(9) comp-3 to save space. . . Lots of innocent people also incorrectly believed that social security number would always be unique (many used ssn as the primary/unique key to "people" data (like payroll, hr, retirement, benefits, etc)). |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
Ya SSN is social security number. I want to compare based on that and want the first file contents to o/p files if the SSN is matched with II file.
Field positions are,
In I file (1,4) --- PIC S9(09) COMP
In II file (1,9) --- PIC 9(09).
Kindly any one help me to achive this requirement.
Regards
R KARTHIK |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Mods,
A PM from the OP says he uses SyncSort. I think this topic can be moved to the JCL forum. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
karthikr44,
AFAIK, Even in SPLICE, you need the keys to be in the same format. Since you already have SyncSort you can achieve this easily using a SyncSort JOIN application following a reformat step to make the keys in the same format. And you dont need as many passes of data as you do in the SPLICE job mentioned above. |
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
Hi karthik,
I dont know this is the correct way for this solution.My suggestion is that you can acheive this by two sort steps.May be by a single ICETOOL step,i'm not familiar with ICETOOL.
My suggestion is that,
STEP1: convert the S9(09) COMP-3 to normal filed(like PIC 9(09))
STEP2: Compare the output from STEP1 and other file by the SORT join.
Guys please confirm can we do like this....
Regards,
Bipin Peter |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
Any updates on this requirement to acheive...
Regards
R KARTHIK |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Bipin Peter has this logic correct. One of the key fields must be coverted to the other format, and then a SyncSort JOIN can be easily performed. The REFORMAT statement will then be:
Code: |
REFORMAT FIELDS=(F1:1,1061) |
|
|
Back to top |
|
|
|