View previous topic :: View next topic
|
Author |
Message |
Ragav86
New User
Joined: 27 Jan 2010 Posts: 37 Location: chennai
|
|
|
|
Hi,
Can anyone help with the below requirement.
I got a requirement to create subtotal report for the input file.
Input file contains below records
Code: |
1111,001,10
1111,002,10
1111,003,10
1111,004,10
1111,005,10
1111,006,10
2222,001,10
2222,002,10
2222,003,10
2222,004,10
2222,005,10
2222,006,10
2222,007,10
3333,001,10
3333,002,10
3333,003,10
3333,004,10
|
Output file should be like this
Code: |
1111,001,10
1111,002,10
1111,003,10
1111,004,10
1111,005,10
1111,006,10
1111,000,60
2222,001,10
2222,002,10
2222,003,10
2222,004,10
2222,005,10
2222,006,10
2222,007,10
2222,000,70
3333,001,10
3333,002,10
3333,003,10
3333,004,10
3333,000,40
|
subtotals should be generated with XXXX,000,subtotal
the sysin statements should not be depends on input data it should be generic. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
//STEP0001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1111,001,10
1111,002,10
1111,003,10
1111,004,10
1111,005,10
1111,006,10
2222,001,10
2222,002,10
2222,003,10
2222,004,10
2222,005,10
2222,006,10
2222,007,10
3333,001,10
3333,002,10
3333,003,10
3333,004,10
//COUNTS DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=COUNTS,REMOVECC,
SECTIONS=(1,4,
TRAILER3=(1,5,C'000,',
TOT=(10,2,ZD,EDIT=(TTT))))
/*
|
Gerry |
|
Back to top |
|
|
Ragav86
New User
Joined: 27 Jan 2010 Posts: 37 Location: chennai
|
|
|
|
thanks its working as expected |
|
Back to top |
|
|
|
|