Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To get total of a report using DFSORT

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

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Mon Jun 06, 2005 11:48 am    Post subject: To get total of a report using DFSORT
Reply with quote

My requirement is to get a formatted report having subtotal regionwise and a grand total. I am just giving an example. All the file are FB and record length of 700.
suppose, following is my two input file,
101 xxxxxxxxxxx
101 xxxxxxxxxxx
102 xxxxxxxxxxx
103 xxxxxxxxxxx
103 xxxxxxxxxxx
104 xxxxxxxxxxx
105 xxxxxxxxxxx

it should display like this
----------------------------------
SUB TOTAL 719.00
----------------------------------

101 xxxxxxxxxxx

----------------------------------
SUB TOTAL 101.00
----------------------------------

----------------------------------
TOTAL 820.00
----------------------------------
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Jun 06, 2005 9:13 pm    Post subject:
Reply with quote

You can do this kind of thing with the report functions of DFSORT's OUTFIL statement, but exactly what you would code depends on exactly what the input looks like and exactly what you want the report to look like.

If you want me to show you how to do what you ant, please give a more detailed example of your input records and exactly what you want the output records/report to look like. Indicate the starting position, length and format of each relevent field (key, amount to be totalled, etc).
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Tue Jun 07, 2005 10:50 am    Post subject: Re: To get total of a report using DFSORT
Reply with quote

Suppose there is a file having Salary, Name and Department. It a Fixed Block file with Record length of 80. The Salary Field starts from Column 40.

Code:

Name             Dept                  Salary
Tom              01                      1000
Harry            01                      2000
Peter            02                      1000
Anita            01                     10000
Hank             01                       100


I want to see the report like this

Code:

SUB TOTAL FOR DEPT 01   13100.00

SUB TOTAL FOR DEPT 02    1000.00

TOTAL IS                14100.00
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jun 07, 2005 9:32 pm    Post subject:
Reply with quote

Here's a DFSORT job that will produce the report you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
Tom                01                    1000
Harry              01                    2000
Peter              02                    1000
Anita              01                   10000
Hank               01                     100
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  SORT FIELDS=(20,2,CH,A)
  OUTFIL REMOVECC,NODETAIL,
    SECTIONS=(20,2,
      TRAILER3=(/,'SUB TOTAL FOR DEPT ',20,2,
        24:TOT=(40,6,FS,EDIT=(IIIIIT)),C'.00')),
    TRAILER1=(/,'TOTAL IS',
        24:TOT=(40,6,FS,EDIT=(IIIIIT)),C'.00')
/*
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 Report cost in CA-dispatch Nileshkul CA Products 3 Wed Jun 07, 2017 10:32 pm
No new posts DSNACCOX (can it be run on 1 db/ts, t... SRICOBSAS DB2 5 Sat May 06, 2017 12:59 am
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 7 Mon Mar 27, 2017 3:59 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us