|
|
| Author |
Message |
socker_dad
Active User
Joined: 05 Dec 2006 Posts: 119 Location: Salem, OR
|
|
|
|
If this has been answered before, please forgive me!
I have two files that need to be compared. File 1 is 220 bytes; File 2 656 bytes. File 2 is built off File 1, but the dates are expanded from MMDDYY to CCYY-MM-DD format (yeah, I know - they didn't do Y2K correctly here) and some of the fields are in different order.
I am limited to File Aid, Beyond Compare and Syncsort. I tried to use FIle Aid XREF with no success, so now I am looking to Syncsort.
Sample File 1:
| Code: |
2 AUDIT-DATA 90
5 AUDIT-DATE 90 051708
5 AUDIT-ACCLTR-SEGMENT 96
7 AUDIT-ACCLTR-LETTER-DATE
96 51908
7 AUDIT-ACCLTR-LETTER-CODE
102 S
7 AUDIT-ACCLTR-REF-NO 103 16-119
7 AUDIT-ACCLTR-LETTER-TYPE
110 DR
7 AUDIT-ACCLTR-REFER-ID 112
7 AUDIT-ACCLTR-USABLE-FILLER
|
Corresponding record from File 2:
| Code: |
2 DL-AUDIT-DATA 120
5 DL-AUDIT-COMMON-DT 120 2008-05-17
5 DL-AUDIT-ACCLTR-SEGMENT 130
7 DL-AUDIT-ACCLTR-LETTER-DT
130 2008-05-19
7 FILLER 140
7 DL-AUDIT-ACCLTR-LETTER-CD
188 S
7 DL-AUDIT-ACCLTR-REF-NBR 189 16-119
7 FILLER 196
7 DL-AUDIT-ACCLTR-MED-REF-ID
257
7 FILLER 263
7 DL-AUDIT-ACCLTR-LETTER-TYPE
271 DR
|
The number of records in both files will always be the same, and they will always be in synced order.
Can Syncsort handle this? |
|
| Back to top |
|
 |
References
|
|
 |
ramsri
Active User
Joined: 18 Oct 2008 Posts: 59 Location: India
|
|
|
|
socker_dad,
You did not mention here on which fields you want to do the comparison
Otherwise, the below job may help you to convert your first file date fields to expanded ones. I just considered the data you have shown in screen prints
| Code: |
//SORT0001 EXEC PGM=SORT
//SORTIN DD *
05170851908 S 16-119 DR
/*
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY,CENTWIN=1980
OUTREC FIELDS=(5,2,Y2C,C'-',1,2,C'-',3,2,10,2,Y2C,C'-0',7,1,C'-',8,2, *
12,12)
/*
|
HTH.  |
|
| Back to top |
|
 |
ramsri
Active User
Joined: 18 Oct 2008 Posts: 59 Location: India
|
|
|
|
socker_dad,
The output looks as given below after conversion.....
| Code: |
2008-05-172008-05-19 S 16-119 DR
|
Thanks. |
|
| Back to top |
|
 |
socker_dad
Active User
Joined: 05 Dec 2006 Posts: 119 Location: Salem, OR
|
|
|
|
Sorry - my bad.
Each field needs to be compared to its corresponding source field, and we recognize that the date fields will show as differences.
It's just trying to get AUDIT-ACCLTR-REF-NO in positions 103-107 of File 1 to be compared to DL-AUDIT-ACCLTR-REF-NBR in 189-196 of File 2 (as an example - each field is required to be compared to its resulting converted field).
Sigh. I wish they would just purchase Comparex and get it over with. |
|
| Back to top |
|
 |
ramsri
Active User
Joined: 18 Oct 2008 Posts: 59 Location: India
|
|
|
|
socker_dad,
You have to create an intermediate file from your file2 there by adjusting the fields of file2 to be in line with file1. This way the comparison becomes easier. You can try this method and use ICETOOL SELECT on the fields to be compared to get the final output.
HTH. |
|
| Back to top |
|
 |
PeD
Senior Member
Joined: 26 Nov 2005 Posts: 354 Location: Belgium
|
|
|
|
| Quote: |
Sigh. I wish they would just purchase Comparex and get it over with.
|
Why not EComp?  |
|
| Back to top |
|
 |
ramsri
Active User
Joined: 18 Oct 2008 Posts: 59 Location: India
|
|
|
|
socker_dad,
Here is an untested ICETOOL solution to deal with your requirement..
| Code: |
//SORT0001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//SSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=YOUR.INPUT.FILE1,DISP=SHR
//IN2 DD DSN=YOUR.INPUT.FILE2,DISP=SHR
//OUT1 DD DSN=&&T1,DISP=(MOD,PASS,DELETE),SPACE=(TRK,(1,1),RLSE)
//OUT2 DD DSN=&&T2,DISP=(MOD,PASS,DELETE),SPACE=(TRK,(1,1),RLSE)
//CON DD DSN=&&T1,DISP=(MOD,PASS,DELETE)
// DD DSN=&&T2,DISP=(MOD,PASS,DELETE)
//OUT3 DD DSN=YOUR.OUTPUT.FILE,DISP=SHR
//TOOLIN DD *
COPY FROM(IN1) TO(OUT1) USING(RAM1)
COPY FROM(IN2) TO(OUT2) USING(RAM2)
SELECT FROM(CON) TO(OUT3) ON(90,10,CH) ON(100,10,CH) ON(112,1,CH) -
ON(113,6,CH) ON(119,2,CH) NODUPS
/*
//RAM1CNTL DD *
SORT FIELDS=COPY,CENTWIN=1980
OUTREC FIELDS=(89X,94,2,Y2C,C'-',90,2,C'-',92,2,99,2,Y2C,C'-0',96,1, *
C'-',97,2,X,102,1,103,6,X,110,2,300:X)
/*
//RAM2CNTL DD *
SORT FIELDS=COPY
OUTREC FIELDS=(90:120,10,100:130,10,111:188,1,112:189,6,119:271,2,300:*
X)
/*
|
Experts may like to better this job....
Thanks. |
|
| Back to top |
|
 |
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1252 Location: Chennai - India
|
|
|
|
Ramsri,
| Quote: |
Here is an untested ICETOOL solution to deal with your requirement..
|
Op wanted a solution with SYNCSORT. ICETOOL is shipped with DFSORT. |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 260 Location: USA
|
|
|
|
| Quote: |
| Op wanted a solution with SYNCSORT. ICETOOL is shipped with DFSORT. |
I know this has been addressed many times in this forum and in others...
SyncSort ships ICETOOL as an alias to SYNCTOOL, so specifying PGM=ICETOOL in a SyncSort environment is valid. |
|
| Back to top |
|
 |
|
|
|