RPGLE: Find the total cost for particular location

5 pts.
Tags:
RPGLE
Actually, now I'm doing a program in RPGLE and I have a file with 3 key fields so it is a list but the first key field is date, second one is company name that is 'CON' and third one is location. So their is a cost field also so I want the total for those same locations but data is ordered by date. So please suggest me what should I do?


Software/Hardware used:
software
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • CharlieBrowne
    Within your RPGLE program use SQL to retrieve the totals by location.
    62,385 pointsBadges:
    report
  • ToddN2000
    Charlie's answer is the easiest. You also have other options. You could build a table in your program or store the data in an array and sort it. It sounds like it may be homework related, what have they covered in class?
    132,520 pointsBadges:
    report
  • philpl1jb
    Or you could create a logical file over the physical keyed by Loc and use that in your program.
    54,090 pointsBadges:
    report
  • ToddN2000
    Try it out. If you still have issues or are getting an error you cannot figure out, post your code here and we will take a look.
    132,520 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: