Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To generate report header, sum trailer in every next page.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vaibhavjadhav

New User


Joined: 27 Jul 2007
Posts: 33
Location: mumbai

PostPosted: Wed Dec 15, 2010 10:39 am    Post subject: To generate report header, sum trailer in every next page.
Reply with quote

Hi,

I am creating a report in ICETOOL where my requirement is as shown below:

input:

001 SE 50
001 TL 60
001 PM 70
002 SE 50
002 PM 30
003 DM 40
003 PM 90

output:

COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 1)
EMP = 001
DES SAL
---- ----
SE 50
TL 60
PM 70
-----
EMP 180

COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 2)
EMP = 002
DES SAL
---- ----
SE 50
PM 30
------
EMP 80

COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 3)
EMP = 003
DES SAL
---- ----
DM 40
PM 90
-----
EMP 130
=====
TOTAL 390

Output Explanation:
The input file should be grouped based on the first field i.e. EMP 001,002...etc, and should written to the output report based on groups as EMP=001,EMP=002, EMP=003. Every group should have header, date and time(format as shown above) and Page no in incrementing order. In every group the sum should be done on SAL field which should have EMP as field name for it(as this has been used for grouping e.g EMP 180 for group 1st). Finally all the sum of groups should be totalled under TOTAL field.

Please help me in solving the above query.
Thanks in advance.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Dec 15, 2010 11:57 pm    Post subject: Reply to: To generate report header, sum trailer in every ne
Reply with quote

Code:

//STEP0100 EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD *                     
001 SE 50                           
001 TL 60                           
001 PM 70                           
002 SE 50                           
002 PM 30                           
003 DM 40                           
003 PM 90                           
//SORTOUT  DD SYSOUT=*               
//SYSIN    DD *                                                       
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:DATE1,81,8,Y4T,WEEKDAY=CHAR9)),
  IFTHEN=(WHEN=(85,2,ZD,EQ,01),OVERLAY=(99:C'JANUARY')),             
  IFTHEN=(WHEN=(85,2,ZD,EQ,02),OVERLAY=(99:C'FEBRUARY')),             
  IFTHEN=(WHEN=(85,2,ZD,EQ,03),OVERLAY=(99:C'MARCH')),               
  IFTHEN=(WHEN=(85,2,ZD,EQ,04),OVERLAY=(99:C'APRIL')),               
  IFTHEN=(WHEN=(85,2,ZD,EQ,05),OVERLAY=(99:C'MAY')),                 
  IFTHEN=(WHEN=(85,2,ZD,EQ,06),OVERLAY=(99:C'JUNE')),                 
  IFTHEN=(WHEN=(85,2,ZD,EQ,07),OVERLAY=(99:C'JULY')),                 
  IFTHEN=(WHEN=(85,2,ZD,EQ,08),OVERLAY=(99:C'AUGUST')),               
  IFTHEN=(WHEN=(85,2,ZD,EQ,09),OVERLAY=(99:C'SEPTEMBER')),           
  IFTHEN=(WHEN=(85,2,ZD,EQ,10),OVERLAY=(99:C'OCTOBER')),             
  IFTHEN=(WHEN=(85,2,ZD,EQ,11),OVERLAY=(99:C'NOVEMBER')),             
  IFTHEN=(WHEN=(85,2,ZD,EQ,12),OVERLAY=(99:C'DECEMBER'))             
                                                                     
  OUTREC IFTHEN=(WHEN=INIT,                                           
  BUILD=(1,10,81:TIME,89,9,C',',99,9,X,87,2,C',',81,4)),             
  IFTHEN=(WHEN=INIT,                                                 
  BUILD=(1,10,81:81,5,X,89,27,SQZ=(SHIFT=LEFT,MID=C' '))),           
  IFTHEN=(WHEN=INIT,                                                 
  FINDREP=(STARTPOS=87,ENDPOS=95,INOUT=(C' ',C'')))                   
                                                                     
  OUTFIL REMOVECC,BUILD=(1:5,3,6:8,3,80:X),                           
  SECTIONS=(1,3,SKIP=P,                                               
  HEADER3=('COMPANY DETAILS - ',81,33,X,'(PAGE - ',PAGE,')',/,       
           'EMP = ',1,3,/,                                           
           'DES  SAL',/,                                             
           '---  ---',/,80:X),                                       
  TRAILER3=('---------',/,'EMP ',TOT=(8,2,ZD,M10,LENGTH=4),/)),       
  TRAILER1=('=========',/,'TOTAL ',TOT=(8,2,ZD,M10,LENGTH=6),/)       

//*
Back to top
View user's profile Send private message
vaibhavjadhav

New User


Joined: 27 Jul 2007
Posts: 33
Location: mumbai

PostPosted: Tue Dec 21, 2010 6:32 pm    Post subject:
Reply with quote

Hi Skolusu,

Thanks a ton ....i did executed the above code and its working fine. icon_biggrin.gif
Back to top
View user's profile Send private message
vaibhavjadhav

New User


Joined: 27 Jul 2007
Posts: 33
Location: mumbai

PostPosted: Wed Dec 29, 2010 5:20 pm    Post subject:
Reply with quote

Hi Skolusu,

In the above requirement there is a small change wherein my input and output is as shown below.

input:
1st part
001 SE 50 AA P
001 TL 60 AA P
001 PM 70 AA Q
002 SE 50 BB R

2nd part
001 SE 50 AA P
001 TL 60 AA P
001 PM 70 AA Q
002 SE 50 BB R
002 SE 50 BB R
output:

The output below has different criterias
1.) when only system is changed then only the total will be printed as shown in 1st part below
2.) when last rec i.e for emp = 002 has more than one records then the output will be as shown in 2nd part.

A.) 1ST PART
COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 1)
EMP = 001 SYSTEM = P
DES SAL CODE SYSTEM
---- ---- ------- --------
SE 50 AA P
TL 60 AA P
-----
EMP 110

COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 1)
EMP = 001 SYSTEM = Q
DES SAL CODE SYSTEM
---- ---- ------- --------
PM 70 AA Q
-----
EMP 70

SYSTEM 180
EMP 180


COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 2)
EMP = 002
DES SAL
---- ----
SE 50
PM 30
------
EMP 80
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 683
Location: Pennsylvania

PostPosted: Wed Dec 29, 2010 7:46 pm    Post subject:
Reply with quote

Which is more likely to happen?

1) It will rain during monsoon season.

2) A Dfsort Topic Starter will change their requirement after a working
solution is provided.

Answer: It is a tie icon_smile.gif

This is a perfect opportunity to study what Skolusu has given and learn about Dfsort.

You can take what you have learned and make this small change yourself.

Which is more likely to happen?

1) You take this opportunity and make the changes yourself.

2) Wait for someone to do it for you.

Answer:
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Generate public-private key in batch ... vasanthz All Other Mainframe Topics 3 Fri Sep 15, 2017 9:20 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us