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

Summing/adding up fileds using sort card


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 45
Location: bangalore

PostPosted: Mon Nov 24, 2008 7:54 pm
Reply with quote

Hi,
I have two input files like like this.

File 1


Code:

Header-rec
pat  maths 25 science 40
mark maths 30 science 50
trailer maths 55 science 90


And file 2 like this
Code:

Header-rec
Trevor  maths 15 science 30
Stephen maths 45 science 40
trailer maths 60 science 70



I need to merge the two files into one file with only one header and one trilaer record and the trailer record should have the sum of both the first file and the second file. For example, file 1 has trailer record with total marks in maths as (25 + 30) = 55 and file 2 has total marks in maths as (15+45) = 60 . So the merged file has the marks in maths in the trailer record as 115 which is the sum of all marks.

Should I use 'sum' to sum the fileds up?
The file length is 32 (15+5+3+6+3)



Code:

Header-rec
pat       maths 25 science 40
mark    maths 30 science 50
Trevor  maths 15 science 30
Stephen maths 45 science 40
trailer maths 115 science 160



Thanks
Roshnii
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 Nov 24, 2008 10:24 pm
Reply with quote

Quote:
The file length is 32 (15+5+3+6+3)


What do those individual lengths represent?

The layout of your input records is not clear. Are the values (e.g. 'pat', 'maths', '25', 'science', '40') in fixed positions or variable positions?

Please describe the layout in detail. Give the starting position, length and format of each relevant field.

Does the header really look like that, or does it look different? If different, what does it look like?

Same question for the trailer.

Is there information in the input header and trailer that has to be kept for output, or can the header and trailer just be rebuilt with the correct information?
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top