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
 

 

Summing/adding up fileds using sort card

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Summing/adding up fileds using sort card
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 Moderator


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

PostPosted: Mon Nov 24, 2008 10:24 pm    Post subject:
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    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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


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