View previous topic :: View next topic
Author
Message
Huan-Nguyen New User Joined: 17 Jan 2006Posts: 17
Hi,
I had a requirement, that I receive several input files with same format layout & the same dataset name each week, but the file contains different type of record to identify the sort position for the file (type of record such as AAAA, BBBB, CCCC, DDDD) , if file has records with type AAAA sort by position 120-123, if file has records with type BBBB sort by position 100-103, if file has records with type CCCC sort by position 90-97, if file has records with type DDDD sort by position 80-85. The file always contains only one type of records.
Can anybody let me know how can I use icetool/dfsort to set up one Sort step to process only one input file but cover for all four the type of record. Thanks in advance for your help !
Code:
EX : FileXXXX
ID-NAME(4 bytes) Data SORT-POSTION ( Postion 120-123)
--------------- ---- ------------------
AAAAA VVVVVVVVVVVVVVVVVVVVVVVV 1010
AAAAA BBBBBBBBBBBBBBBBBBBBBBBB 1009
AAAAA NNNNNNNNNNNNNNNNNNNNNNNN 1011
AAAAA XXXXVVVVVVVVVVVVVVVVVVVV 1015
AAAAA VVVVBBBBBBBBBBBBBBBBBBBB 1009
AAAAA DDDDDNNNNNNNNNNNNNNNNNNN 1031
EX : FileXXXX
ID-NAME(4 bytes) Data SORT-POSTION ( Postion 100-103)
--------------- ---- ------------------
BBBB VVVVVVVVVVVVVVVVVVVVVVVV 1010
BBBB BBBBBBBBBBBBBBBBBBBBBBBB 1009
BBBB NNNNNNNNNNNNNNNNNNNNNNNN 1011
EX : FileXXXX
ID-NAME(4 bytes) Data SORT-POSTION ( Postion 90-97)
--------------- ---- ------------------
CCCC VVVVVVVVVVVVVVVVVVVVVVVV 1010VVVV
CCCC BBBBBBBBBBBBBBBBBBBBBBBB 1009XXXX
CCCC NNNNNNNNNNNNNNNNNNNNNNNN 1011CCCC
EX : FileXXXX
ID-NAME(4 bytes) Data SORT-POSTION ( Postion 80-85)
--------------- ---- ------------------
DDDD VVVVVVVVVVVVVVVVVVVVVVVV 101056
DDDD BBBBBBBBBBBBBBBBBBBBBBBB 1009VV
DDDD NNNNNNNNNNNNNNNNNNNNNNNN 101177
DDDD VVVVVVVVVVVVVVVVVVVVVVVV 10105F
DDDD BBBBBBBBBBBBBBBBBBBBBBBB 1009VC
DDDD NNNNNNNNNNNNNNNNNNNNNNNN 10117D
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
What is the RECFM and LRECL of each input file?
Please show the expected output records.
Back to top
Huan-Nguyen New User Joined: 17 Jan 2006Posts: 17
Frank Yaeger wrote:
What is the RECFM and LRECL of each input file?
Please show the expected output records.
Recort format FB, Record lenght 150 bytes.
If file has record type AAAA
The expected output is :
AAAA BBBBBBBBBBBBBBBBBBBBBBBB 1009
AAAA VVVVBBBBBBBBBBBBBBBBBBBB 1009
AAAA VVVVVVVVVVVVVVVVVVVVVVVV 1010
AAAA NNNNNNNNNNNNNNNNNNNNNNNN 1011
AAAA XXXXVVVVVVVVVVVVVVVVVVVV 1015
AAAA DDDDDNNNNNNNNNNNNNNNNNNN 1031
If file has record type BBBB
The expected output is :
BBBB BBBBBBBBBBBBBBBBBBBBBBBB 1009
BBBB VVVVVVVVVVVVVVVVVVVVVVVV 1010
BBBB NNNNNNNNNNNNNNNNNNNNNNNN 1011
If file has record type CCCC
The expected output is :
CCCC BBBBBBBBBBBBBBBBBBBBBBBB 1009XXXX
CCCC VVVVVVVVVVVVVVVVVVVVVVVV 1010VVVV
CCCC NNNNNNNNNNNNNNNNNNNNNNNN 1011CCCC
If file has record type CCCC
The expected output is :
DDDD BBBBBBBBBBBBBBBBBBBBBBBB 1009VC
DDDD BBBBBBBBBBBBBBBBBBBBBBBB 1009VV
DDDD VVVVVVVVVVVVVVVVVVVVVVVV 10105F
DDDD VVVVVVVVVVVVVVVVVVVVVVVV 101056
DDDD NNNNNNNNNNNNNNNNNNNNNNNN 10117D
DDDD NNNNNNNNNNNNNNNNNNNNNNNN 101177
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Do you want four output files - one for each record type?
Or do you want one output file with all of the records?
Back to top
Huan-Nguyen New User Joined: 17 Jan 2006Posts: 17
Hi Frank,
I would like the sort step process one input file & the produce one output file. Thanks,
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Oh, I missed the part where you said
Quote:
The file always contains only one type of records.
Now I understand.
Here's a DFSORT job that will do what you asked for.
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/150)
//SORTOUT DD DSN=... output file (FB/150)
//SYSIN DD *
INREC IFOUTLEN=158,
IFTHEN=(WHEN=(1,4,CH,EQ,C'AAAA'),
OVERLAY=(151:120,4)),
IFTHEN=(WHEN=(1,4,CH,EQ,C'BBBB'),
OVERLAY=(151:100,4)),
IFTHEN=(WHEN=(1,4,CH,EQ,C'CCCC'),
OVERLAY=(151:90,8)),
IFTHEN=(WHEN=(1,4,CH,EQ,C'DDDD'),
OVERLAY=(151:80,6))
SORT FIELDS=(151,8,CH,A)
OUTREC BUILD=(1,150)
/*
Back to top
Huan-Nguyen New User Joined: 17 Jan 2006Posts: 17
Thank you very much, I very appreciate your kind help.
Back to top
Please enable JavaScript!