View previous topic :: View next topic
Author
Message
neelima.sinha New User Joined: 14 Sep 2007Posts: 30 Location: Bangalore
I have a file with data
L,A,10000
M,B,20000
P,C,30000
L,D,15000
L,E,05000
M,F,30000
I want output in the format
Machine Stream number
L A 10000
L D 15000
L E 05000
------------------------------------
Total for L = 30000
M B 20000
M F 30000
-----------------------------------
Total for M = 50000
P C 30000
-----------------------------------
Total for P = 30000
-----------------------------------
GRAND total (L+M+P) = 110000
How do I create a report of above format using Display of ICETOOL
Back to top
CICS Guy Senior Member Joined: 18 Jul 2007Posts: 2146 Location: At my coffee table
Back to top
neelima.sinha New User Joined: 14 Sep 2007Posts: 30 Location: Bangalore
Yes I did!
I am aware that display can do this.....
But not able to understand how it functions
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
neelima.sinha,
The following DFSORT JCL will give you the desired results
Code:
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
L,A,10000
M,B,20000
P,C,30000
L,D,15000
L,E,05000
M,F,30000
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,1,CH,A)
OUTFIL REMOVECC,
SECTIONS=(1,1,
TRAILER3=(25'-',/,'TOTAL FOR ',1,1,C' = ',
TOT=(5,5,ZD,M10,LENGTH=8))),
TRAILER1=(25'-',/,'GRAND TOTAL (L+M+P) = ',
TOT=(5,5,ZD,M10,LENGTH=8))
/*
Hope this helps...
Cheers
Back to top
neelima.sinha New User Joined: 14 Sep 2007Posts: 30 Location: Bangalore
Not sure why...but above mentioned solution is not working....
Back to top
neelima.sinha New User Joined: 14 Sep 2007Posts: 30 Location: Bangalore
Also if anybody can explain how to use display to get this report it would be helpful
Thanks
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8797 Location: Welsh Wales
neelima.sinha wrote:
Not sure why...but above mentioned solution is not working....
So why not post the output from the failing solution so that we can actually see what is or is not happening.
Back to top
neelima.sinha New User Joined: 14 Sep 2007Posts: 30 Location: Bangalore
Ran fine.... Sortout statement was missing.....
Thanks for this.....
if an alternative solution via DISPLAY of icetool is provided that would be great
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
DISPLAY cannot produce a report in exactly the format you showed. That's why Kolusu used OUTFIL which can.
Here's the closest I could get with DISPLAY. Note that you'll need z/OS DFSORT V1R5 PTF UK90013 (July, 2008) to use NOCC (you can remove it if you don't have that PTF).
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
L,A,10000
M,B,20000
P,C,30000
L,D,15000
L,E,05000
M,F,30000
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN) TO(T1) USING(CTL1)
DISPLAY FROM(T1) LIST(OUT) NOCC -
HEADER('Machine') ON(1,1,CH) -
HEADER('Stream') ON(3,1,CH) -
HEADER('Number') ON(5,5,ZD,U06) -
BETWEEN(5) -
BTITLE('Records for ') BREAK(1,1,CH) -
BTOTAL('Break total') TOTAL('Grand total (L+M+P)')
/*
OUT would have:
Code:
Records for L
Machine Stream Number
------- ------ -------
L A 10000
L D 15000
L E 5000
Break total 30000
Records for M
Machine Stream Number
------- ------ -------
M F 30000
M B 20000
Break total 50000
Records for P
Machine Stream Number
------- ------ -------
P C 30000
Break total 30000
Machine Stream Number
------- ------ -------
Grand total (L+M+P) 110000
Back to top
Please enable JavaScript!