nithyaroslin
New User
Joined: 29 Jan 2008 Posts: 14 Location: Chennai
|
|
|
|
Hi,
I have a requirement as follows.
The input for sort is the GDG base. Each generation is as follows.
File1
Code: |
UHDR20101101
ZZZZ00001
BBBB00002
ZZZZ00001
UTRL000005
|
File2
Code: |
UHDR20101102
ZZZZ00001
AAAA00002
UTRL000004
|
The expected output is as follows.
Code: |
UHDR20101101
BBBB00002
ZZZZ00001
UTRL000005
UHDR20101102
AAAA00002
ZZZZ00001
UTRL000004
|
The keypoints to attain this particular output file are
1. The trailer and header should not be affected.
2. The duplicate records found within that particular header and trailer only should be removed. If the same record is found in another file, it should not be disturbed.
3. sort the records within that particular header and trailer in increasing order. |
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
nithyaroslin,
Assuming that the GDG generations all have an LRECL of 80 and FB recfm, the following DFSORT/ICETOOL JCL will give you the desired results
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=Your GDG base,DISP=SHR
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(81,4,CH) ON(1,10,CH) FIRST USING(CTL1)
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(84:C'2')),
IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'UHDR'),
END=(1,4,CH,EQ,C'UTRL'),PUSH=(81:ID=3)),
IFTHEN=(WHEN=(1,4,CH,EQ,C'UHDR'),OVERLAY=(84:C'1')),
IFTHEN=(WHEN=(1,4,CH,EQ,C'UTRL'),OVERLAY=(84:C'3'))
OUTFIL FNAMES=OUT,BUILD=(1,80)
//* |
|
|