Solved

COBOL Error

Posted on 2010-11-29
10
717 Views
Last Modified: 2012-06-21
Disclaimer: I'm taking a class.

I'm trying to find an error in this COBOL code; this file is related to the items at http://www.experts-exchange.com/Programming/Algorithms/Q_26637173.html.

Do you have any hints?
0
Comment
Question by:JCW2
  • 5
  • 5
10 Comments
 
LVL 54

Expert Comment

by:Bill Prew
ID: 34235539
Can you be any more specific, what is or isn't happening that you are trying to track down?  Or are you getting a syntax error of some sort?  What have you determined so far?

~bp
0
 
LVL 54

Expert Comment

by:Bill Prew
ID: 34235592
Or are you trying to answer the assignment question of:

For example the first row of output program CBL1008 is for Anchorage
Alaska and the four quarters reported are:
48,710,830-    950,870,160-    427,544,050+    175,897,950-

The above totals to 747,934,890-

However, CBL2008 reported total for Anchorage Alaska is 47,934,890-

Correct CBL2008 program to accurately total the four quarters for
each city/county.
If that is the problem to be solved, I do see why that would be happening.  But honestly, I don't think EE is the place to get direct answers to class assignments, so I;m not going to just post that, it wouldn't be fair to you.

I would suggest you walk through the logic on 2008 and look for any potential problems in the way it derives the totals.

~bp
0
 

Author Comment

by:JCW2
ID: 34235698
Okay, I'm looking at the picture clauses. I'm not familiar with that structure, so can you explain things such that I understand how they affect the program, and the clauses themselves?
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 54

Expert Comment

by:Bill Prew
ID: 34235952
What class are you taking where they haven't taught you about picture clauses, but are debugging COBOL programs?  And don't you have a text or reference on the language.

~bp
0
 

Author Comment

by:JCW2
ID: 34241345
I'm in a mainframing course. I have a reference, but do you have anything at all to say about picture clauses? I'm a little confused.
0
 
LVL 54

Expert Comment

by:Bill Prew
ID: 34243518
So, do you understand what the following means at all?  (trying to figure out how to help you without giving away the answer...)

PIC S9(8) COMP-3

~bp
0
 

Author Comment

by:JCW2
ID: 34254388
Signed number with 8 digits
0
 

Author Comment

by:JCW2
ID: 34254392
(packed decimal)
0
 
LVL 54

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 34254445
So, if you manually add up the quarter totals that you are trying to compute a year total from, what number do you come up with and how does it compare to that picture clause on the totaling variable?

~bp
0
 

Author Closing Comment

by:JCW2
ID: 34288147
Thank you for your help.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Auto-indent certain lines in Notepad++ 10 113
Advice in Xamarin 21 97
iSeries email authority 6 75
Query group by data in SQL Server - cursor? 3 50
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question