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
 
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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

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