i'd like to compare two records from a sequential (FB) dataset and i want to get an output dataset that contains both records if they are not equal.
so far it is not very difficult, but i'd like to have markers in that output dataset in a third line that show where the differences are.
but this is too much work if i need that for several files with different LRECLs.
now i meditated a long time over the DFSORT Application programming guide looking for a way to use different LRECLs without defining a ITHEN-statement for each byte, but i could not find a way...
perhaps a DFSORT specialist can !?
probably DFSORT is the wrong tool for doing that...?
it was very hard for me to find out what his code does ;)
after that it was even harder to find a way to make it 'dynamic'
and since Kolusu did not provide a dynamic solution i realized that
there is none...
I never used DFSORT before,
my project manager told me to use it for that requirement instead of writing a COBOL - pgm...
he said this must be easy with DFSORT,
now i have found one more point he does not know at all...
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Many types of compare operations are relatively easy with DFSORT/ICETOOL. However, what you're trying to do is not one of them. I suspect your project manager is not aware of that. I just spoke to Kolusu and he wasn't aware you wanted a "dynamic solution". The IFTHEN clauses can be generated dynamically. Kolusu volunteered to show you how to do that later today.
Of course, you and your project manager will have to evaluate for yourselves whether or not that's the best way to do what you want to do.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I never used DFSORT before
If you want to educate yourself on all of the thing DFSORT/ICETOOL can do well, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
dr.ostman,
Here is DFSORT/ICETOOL Job which will give the desired results. However there are certain limitations for the job.
1. We can compare upto a max lrecl of 9999.
2. Input files are are always FB (no variable block files)
You need to supply the LRECL of the file to be compared via SYMNAMES DD.
Code:
//SYMNAMES DD *
LRECL,+nnnn
The range of n is from +1 to +4096.
Once you supply the LRECL in STEP0100 of the job it automatically builds the control cards on the fly and the actual compare is done in step0200 using the dynamic control cards created in step0100.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Quote:
this job does exacly what i need ! but now it is even harder to understand what it does. .. ;-)
The job basically generates the dynamic control cards on the fly. TO better understand the job change the temp datasets to permanent datasets and see the contents of them.
Just run only step0100 with all permanent datasets and browse the contents of them
Quote:
there is only one issue: it adds one Byte to the output records. if i use 80 bytes as length the resulting OUT has 81 Bytes.
hmm I re-ran the job once again and I still get the correct output of 80 bytes. If I had to guess then you input file might be a FBA file. Show me your DFSMSG sysout from step0200. Or just show me messages ICE088I and ICE210I.
as others have stated before I DO think dfsort/syncsort are not the proper tools for this task, as enrico I'd try SUPERC or even try Cobol (or Rexx!!!!).
can you imagine yourself changing that sysin becouse the file copybook has changed?
ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW
DEBUG NOABEND,ESTAE
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL1,SORTIN=IN,S
TOUT=T1,DYNALLOC,SZERO,EQUALS,NOVLSHRT,LOCALE=NONE,NOC
CK
SORT FIELDS=(161,8,CH,A)
MODS E35=(ICE35DU,12288)
ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE193I 0 ICEAM2 ENVIRONMENT IN EFFECT - ICEAM2 INSTALLATION MODULE SELECTED
ICE088I 1 K010A@AZ.STEP0100. , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE093I 0 MAIN STORAGE = (MAX,4194304,4169728)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (4112368,4112368)
ICE127I 0 OPTIONS: OVFLO=RC16,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y
ICE128I 0 OPTIONS: SIZE=4194304,MAXLIM=1048576,MINLIM=450560,EQUALS=Y,LIST=Y,ER
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=N,WRKREL=Y,OUTREL=Y,CKPT
ICE131I 0 OPTIONS: TMAXLIM=4194304,ARESALL=0,ARESINV=0,OVERRGN=16384,CINV=Y,CFW
OPTIONS: VLSHRT=N,ZDPRINT=N,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXIT
OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=2097152,SOLRF=Y,VLLONG=
BSAM ACCESS METHOD USED FOR IN
DC 500000 TC 0 CS DSVNN KSZ 12 VSZ 12
FSZ=6250 RC IGN=0 E AVG=172 0 WSP=1396 C DYN=0 0
STORAGE USED FOR OUTFIL : BELOW 16M = 22528, ABOVE 16M = 2114560
T1 : EXCP USED, LRECL = 240, BLKSIZE = 27840, TYPE = FB (SDB)
IN MAIN STORAGE SORT
INSERT 2, DELETE 2
RECORDS - IN: 2, OUT: 2
T1 : DELETED = 0, REPORT = 0, DATA = 2
T1 : TOTAL IN = 2, TOTAL OUT = 2
NUMBER OF BYTES SORTED: 160
TOTAL WORK DATA SET TRACKS ALLOCATED: 0 , TRACKS USED: 0
HIPERSPACE STORAGE USED = 0K BYTES
DATA SPACE STORAGE USED = 0K BYTES
C5C6C7C8E9C9E5E6E7DED5D9CBE8
END OF DFSORT
IDENTIFIER FROM CALLING PROGRAM IS 0002
BLOCKSET COPY TECHNIQUE SELECTED
- CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 00:12 ON TUE FEB
OUTFIL FNAMES=OUT,IFOUTLEN=80,
IFTHEN=(WHEN=(161,80,CH,EQ,C' '),BUILD=(01,80,/,081,80)),
IFTHEN=(WHEN=NONE,BUILD=(01,80,/,161,80,/,081,80))
END OF STATEMENTS FROM CTL2CNTL - PARAMETER LIST STATEMENTS FOLLOW
DEBUG NOABEND,ESTAE
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL2,SORTIN=T1,S
TOUT=OUT,DYNALLOC
SORT FIELDS=COPY
RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICEAM2 ENVIRONMENT IN EFFECT - ICEAM2 INSTALLATION MODULE SELECTED
K010A@AZ.STEP0100. , INPUT LRECL = 240, BLKSIZE = 27840, TYPE
MAIN STORAGE = (MAX,4194304,4194304)
MAIN STORAGE ABOVE 16MB = (4136944,4136944)
OPTIONS: OVFLO=RC16,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y
OPTIONS: SIZE=4194304,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ER
OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT
OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT
OPTIONS: TMAXLIM=4194304,ARESALL=0,ARESINV=0,OVERRGN=16384,CINV=Y,CFW
OPTIONS: VLSHRT=N,ZDPRINT=N,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXIT
OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=2097152,SOLRF=Y,VLLONG=
EXCP ACCESS METHOD USED FOR T1
STORAGE USED FOR OUTFIL : BELOW 16M = 25600, ABOVE 16M = 2114560
OUT : BSAM USED, LRECL = 80, BLKSIZE = 27840, TYPE = FB
INSERT 0, DELETE 0
RECORDS - IN: 2, OUT: 2
OUT : DELETED = 0, REPORT = 0, DATA = 6
OUT : TOTAL IN = 2, TOTAL OUT = 6
ICE751I 0 C5C6C7C8E9C9E5E7EFCBF0E8
ICE052I 0 END OF DFSORT
TOOLMSG:
Code:
ICE600I 0 DFSORT ICETOOL UTILITY RUN STARTED
ICE632I 0 SOURCE FOR ICETOOL STATEMENTS: TOOLIN
ICE630I 0 MODE IN EFFECT: STOP
SPLICE FROM(IN) TO(T1) WITHEACH ON(161,08,CH) -
WITH(081,80) KEEPNODUPS USING(CTL1)
ICE606I 0 DFSORT CALL 0001 FOR SORT FROM IN TO T1 USING CTL1CNTL CO
ICE628I 0 RECORD COUNT: 000000000000002
ICE638I 0 NUMBER OF RECORDS RESULTING FROM CRITERIA: 000000000000002
ICE602I 0 OPERATION RETURN CODE: 00
COPY FROM(T1) TO(OUT) USING(CTL2)
ICE606I 0 DFSORT CALL 0002 FOR COPY FROM T1 TO OUT USING CTL2CNTL CO
ICE602I 0 OPERATION RETURN CODE: 00
ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE: 00
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
A day to write a COBOL program to do this, and another half a day to change it to handle the changed spec's (multiple different record lengths) and this discussion has gone on for 12 days. What a waste.
Here is DFSORT/ICETOOL Job which will give the desired results. However there are certain limitations for the job.
1. We can compare upto a max lrecl of 9999.
2. Input files are are always FB (no variable block files)
You need to supply the LRECL of the file to be compared via SYMNAMES DD.
Code:
//SYMNAMES DD *
LRECL,+nnnn
The range of n is from +1 to +4096.
Once you supply the LRECL in STEP0100 of the job it automatically builds the control cards on the fly and the actual compare is done in step0200 using the dynamic control cards created in step0100.
Hello Skolusu, I know it's been a while now, but is the above code still valid.. I tried to run it for 380 LRECL but it failed at STEP0200 giving
Code:
ICE000I 0 - CONTROL STATEMENTS FOR 5650-ZOS, Z/OS DFSORT V2R1 - 15:08 ON TUE SE
OUTFIL FNAMES=OUT,IFOUTLEN=0380,
IFTHEN=(WHEN=(0761,0380,CH,EQ,C' '),BUILD=(01,0380,/,0381,0380)),
IFTHEN=(WHEN=NONE,BUILD=(01,0380,/,0761,0380,/,0381,0380))
ICE146I 0 END OF STATEMENTS FROM CTL2CNTL - PARAMETER LIST STATEMENTS FOLLOW
DEBUG NOABEND,ESTAE
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL2,SORTIN=M1,SO
TOUT=OUT,DYNALLOC
SORT FIELDS=COPY
ICE221A 1 INVALID FIELD OR CONSTANT IN OUT IFTHEN 1 CONDITION 1