thunderstorm
New User
Joined: 23 Mar 2007 Posts: 35 Location: pune
|
|
|
|
Hi
I have a requirement
1. Input file is 80 bytes long
2. There are 3 primary fields
Colm 1 thru 3 makes Field 1
Colm 4 thru 8 makes Field 2
Colm 50 makes Field 3
3. I need the output file to have
i. all the three fields together with duplicates eliminated
ii. An extra row with field 1 , space in field 2 and the value 'A' in field 3
iii. after combining records of i & ii , the records should be sorted on the entire length
Is it possible to do it in a single step ?
Input file
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--------8
11112054 A
11112054 A
11112321 A
11112431 A
22210033 A
22210033 A
22211021 A
33312011 B
33312012 B
33312012 B
33312013 B
33312024 B
55514562 A
55515621 A |
Output file
Code: |
----+----1
**********
111 A
11112054A
11112321A
11112431A
222 A
22210033A
22211021A
333 A
33312011B
33312012B
33312013B
33312024B
555 A
55514562A
55515621A |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that produces the output you show from the input you show.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file (FB/9)
//SYSIN DD *
INREC BUILD=(1,8,50,1)
SORT FIELDS=(1,9,CH,A)
SUM FIELDS=NONE
OUTFIL REMOVECC,
SECTIONS=(1,3,
HEADER3=(1,3,9:C'A'))
/*
|
|
|