View previous topic :: View next topic
|
Author |
Message |
noorkh
New User
Joined: 06 Mar 2006 Posts: 76 Location: Chennai
|
|
|
|
I have below requirement.
I have an 80 byte FB file as follows:
File a:
Code: |
Matching key:(1-20) amount date
xxxxxxxxxxxxx 123 11-dec
xxxxxxxxxxxxx 123.2 12-dec
yyyyyyyyyyyyy 124.1 11-dec
yyyyyyyyyyyyy 124 12-dec
yyyyyyyyyyyyy 126.2 12-dec
zzzzzzzzzzzzzzz 125 11-dec
|
If you see above file, there are duplicates found in matching for different amount and different date or same date.
I want to flattern all duplicate records into single record as follows:
Output:
Code: |
Matching Key amt1 date1 amt2 date2 amt3 date3
xxxxxxxxxxx 123 11-dec 123.2 12-dec ---- -----
yyyyyyyyyyy 124.1 11-dec 124 12-dec 126.2 12-dec
zzzzzzzzzzzzz 125 11-dec
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
What is the maximum number of duplicates you expect for a single key?
What is the maximum number of amt/date fields you expect in an output record? Can one key require more than one line? |
|
Back to top |
|
|
noorkh
New User
Joined: 06 Mar 2006 Posts: 76 Location: Chennai
|
|
|
|
Hi Frank,
Thanks for your reply.
Maximum duplicate could be 50.
As maximum duplicate is 50, i expect maximum 50 amount/date fields in output.
I need 1 key in single line. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
noorkh,
It can be done with group or splice depending on your version of SORT.
Can you provide me with the following details?
1. what is the cobol layout of the input file
2. what is LRECL and recfm of the input and desired OUTPUT file?
run this job and show me the sysout which would help me determine the level of DFSORT you are running
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
/*
|
|
|
Back to top |
|
|
|