Posted: Thu Nov 15, 2007 12:15 pm Post subject: Report creation while two header field values are changing
Hello,
I need a help in creating a report using DFSORT. Actually the report should like below :
Code:
Department : 001
Member : A
---------------
Item No. of distribution
1 200
2 100
3 500
Department : 001
Member : B
---------------
Item No. of distribution
4 500
5 100
6 500
Department : 002
Member : C
---------------
Item No. of distribution
7 300
8 100
9 500
Department : 003
Member : D
---------------
Item No. of distribution
7 300
8 100
9 500
Department : 003
Member : E
---------------
Item No. of distribution
7 300
8 800
9 500
I am able to get the report whenever the value of Member changes using SECTIONS in OUTFIL, but I am not getting the report accurate when the department is also changing.
So, the requirement is to report the department in the header of the report too, whose value might be changing.
It would be great if anyone could let me know how this can be acheived.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Nov 15, 2007 1:10 pm Post subject:
Panabesh,
Here's a DFSORT job that will do what you asked for. You didn't show what your input records look like, so I made up some input records to give you the idea. Just change the job appropriately to reflect what the input records actually look like.
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
001 A 1 200
001 A 2 100
001 A 3 500
001 B 4 500
001 B 5 100
001 B 6 500
002 C 7 300
002 C 8 100
002 C 9 500
002 D 7 300
002 D 8 100
002 D 9 500
003 E 7 300
003 E 8 800
003 E 9 500
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,5,CH,A)
OUTFIL SECTIONS=(1,5,SKIP=1L,
HEADER3=('Department : ',1,3,/,
'Member : ',5,1,/,
'---------------',/,
'Item No. of distribution')),
BUILD=(7,1,17:9,3,80:X)
/*
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Nov 15, 2007 5:13 pm Post subject:
My crystal ball is working well today. 8) _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum