op
New User
Joined: 31 Oct 2006 Posts: 48 Location: Chennai
|
|
|
|
Hi,
My input file is a FB of LRECL 1500.
The key of the file is a 31-length character, starting from position 1.
At position 208, i have a date field of format DDMMYYYY.
There can be more than 1 record with the same key, but different date.
Ex:
Key1.....20122006
Key2.....21122006
Key2.....27122006
Key2.....18122006
Key2.....26122006
My requirement is I need only one record per Key and with the highest Date, in the output.
Please help.
Thanks,
OP |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB/1500)
//OUT DD DSN=... output file (FB/1500)
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,31,CH) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,31,CH,A,214,4,CH,D,210,2,CH,D,208,2,CH,D)
/*
|
|
|