View previous topic :: View next topic
|
Author |
Message |
rmd3003
New User
Joined: 03 Jul 2006 Posts: 55
|
|
|
|
I spent some time reading manuals but still............
Maybe somebody has similar example.
This is my input (I simplified to make it easier)..
Code: |
----+----1----+----2----+----
NAME1 100 010
NAME2 100 010
NAME3 100 010
NAME4 100 010
NAME5 100 010
|
I need to produce report like this (it has to be in CSV format so I insert ").
Trailer has to sum some fields.
Code: |
REPORT NAME GOES HERE DATE: 2010-07-14
"100" "010"
"100" "010"
"100" "010"
"100" "010"
"100" "010"
TOTAL: "500" "050"
|
Thank you. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
rmd3003,
Use the following DFSORT JCL
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5----+----6---
NAME1 100 010
NAME2 100 010
NAME3 100 010
NAME4 100 010
NAME5 100 010
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,
BUILD=(9:C'"',10,3,C'"',19:C'"',20,3,C'"',80:X),
HEADER1=(7:'REPORT NAME GOES HERE DATE: ',DATE=(4MD-)),
TRAILER1=('TOTAL',X,
TOT=(10,3,ZD,EDIT=("IIIIT)),'"',2X,
TOT=(20,3,ZD,EDIT=("IIIIT)),'"')
//* |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
NAME1 100 010
NAME2 100 010
NAME3 100 010
NAME4 100 010
NAME5 100 010
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
HEADER1=(7:'REPORT NAME GOES HERE',
32:'DATE: ',DATE=(4MD-)),
BUILD=(9:C'"',10,3,C'"',19:C'"',20,3,C'"',80:X),
TRAILER1=('TOTAL:',9:C'"',TOTAL=(10,3,ZD,TO=ZD,LENGTH=3),
19:C'"',TOTAL=(20,3,ZD,TO=ZD,LENGTH=3),
C'"')
/*
|
|
|
Back to top |
|
|
rmd3003
New User
Joined: 03 Jul 2006 Posts: 55
|
|
|
|
Wow, awesome guys. Thank you very much. |
|
Back to top |
|
|
|
|