I have a file of length 80. The requirement is to check
1.if the 1st 9 bytes of the file. If there are duplicates then check the next set of 9 bytes (10-18). If that also matches, then it should be written into Output file F1.
2. If there are no duplicates in the 1-9 bytes of the file, then also it should be written into Output file F1.
3. If the bytes 1-9 are same and 10-18 are different, then it needs to be written into Output File F2.
Currently am planning to have 2 Sort Steps.
Step 1
Filter out all duplicate records (on 1-9 bytes) from Input file using ICETOOL - ALLDUPS (Output file F2).
Non Duplicate records pushed into Output file F1
Step 2
Sort the output of Step 1 on bytes 1-9 and 10-18. If there are duplicates, i write into Output file F1 (using MOD)
If they don't match, then write into Output file F3.
The 1st 3 records, has same value in 1-18 bytes, so it has to be written into Output file F1 (Requirement 1 in the above post).
Records 4 through 6, has same value for 1st 9 bytes (B12345678), but the next 9 bytes have different value. Hence it has to be written into Output file F2 (Requirement 3 in the above post).
In Last 2 reocrds, there are no duplicate values for the bytes 1 through 9, hence it needs to be written into Output file F1 (Requirement 2 in the above post).
The first 9 bytes (1-9) are Account numbers and the next set (10-19) are dates.
My Output file F1 should not contain duplicate accounts (.i.e. There should be only one record for Account number - date combination). Records 8 and 9 meet this requirement.
If there are multiple records with the same Account number and Same date (records 1 through 3 meet this requirement), then that should also be considered .i.e. Records 1 to 3 should be written into Output file F1
If there are multiple records with same account number but if the dates are different (records 4 through 7 meet this requirement. There are different dates for the same Account number), Then all these four records should be written into a separate Output file F2.
SYNCSORT FOR Z/OS 1.4.0.1R U.S. PATENTS: 4210961, 5117495 (C) 2010 SYNCSORT INC. DATE=2012/352 TIME=03.49.23
z/OS 1.13.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 1B593, MODEL 2097 734 LICENSE/PRODUCT EXPIRATION DATE: 02 MAR 2013
SYSIN :
OPTION COPY
WER276B SYSDIAG= 12561134, 21228076, 21228076, 8622750
WER164B 6,884K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 332K BYTES USED
WER146B 32K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER073I SORTIN : DSNAME=A494472.TICEMAN.JOB58057.D0000101.?
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER074I SORTOUT : DSNAME=NULLFILE
WER410B 5,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 216K BYTES USED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B BSAM WAS USED FOR SORTIN
WER416B BSAM WAS USED FOR SORTOUT
WER054I RCD IN 1, OUT 1
WER169I RELEASE 1.4 BATCH 0520 TPF LEVEL 0.1
WER052I END SYNCSORT - TICEMAN,S1,,DIAG=8200,400E,AAA0,00E6,CA5E,6CA3,AAE8,EC64
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Quote:
My Output file F1 should not contain duplicate accounts (.i.e. There should be only one record for Account number - date combination). Records 8 and 9 meet this requirement.
If there are multiple records with the same Account number and Same date (records 1 through 3 meet this requirement), then that should also be considered .i.e. Records 1 to 3 should be written into Output file F1
Well, i'm confused
Please post what the output should be for the sample input data posted.
The first SELECT statement segregates Duplicate Account numbers (into FIle 3) and Unique Account numbers into File 2
The Second SELECT statement analyzes the File 3 (which contains the Duplicate Account numbers) on Account number and Date. If there are duplicate records on with same Account number and Date, it is moved to Output File F2. Rest (same Account number but different dates) are moved to Output File F1
Since I have used Disposition as MOD for File F2, i am copying contents of File 2 to File 4
Why the BUILDs? Are you reducing the length of records? If you are, all records should be 238 after the first SELECT. Three outputs from the first SELECT? In the second SELECT OUT3 as input and output?
Did you try the two-step approach you were considering? How does it do in terms of resources compared to this?