IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To get total of a report using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Mon Jun 06, 2005 9:13 pm
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
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 Developer


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

PostPosted: Tue Jun 07, 2005 9:32 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top