Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need solution from old COBOL text

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Help !!!!!

I need the solution to programming assignment 10-3 on page 539 of the old COBOL
text called

3rd Edition Structured COBOL 74/85 by Welburn and PRice

it is a company departmental earnings report

thanks !!!!!!!!
 
Hi,

perhaps you can put the text of that assignment here.

 
Here is the Problem: ANY HELP IS MUCH APPRECIATED

Here are the input fields: plant no., dept no., employee no., lastname, firstname, earnings this period(per employee), earnings year to date(per employee).

thd input earnings record has been sequenced by employee number, within dept no, within plant no.

Here is what the assignment asks for:

1. Process each input record.
2. Print the 5 heading lines on the first page and each page thereafter
a. the first record of the file should be the "period ending" date record and stored in the first heading lind
b. print the run date on the second heading line
c. accumulate and print the page number on the third heading line
d. print the plant identification (as explained below) on the fourth heading line
3. Whenever a new plant group is started, skip to a new report page. IN other words, each plant control group should be on a separate page.
a. the abbreviation stored in the plant field should be converted to the complete plant identification as follows:
ATL - atlantic
CTL - central
MTN - mountain
PAC - pacific
b. the applicable plant identification should be printed on the fourth heading line of each page.
4. For each input earnings record, do the following processing:
a. on the detail line, provide the group indication for the plant and department number fields. That is, print the plant field only on the first detail line of the page and on the first detail line when the plant changes. Print the department number field only on the first detail line of each page and on the first detail line when the value of the department number field changes.
b. print an output detail line as specified on the print chart.
c. accumulate the THis-Period earnings and YTD earnings fields.
5. Print the control total lines as follows:
a. whenever the department number and/or plant no changes, print a department number control total line (one asterisk total ) as shown on the print chart
b. whenever the plant changes, print a plant control total line (two asterisk total) as shown on the print chart. PRint the plant identification on this line as explained in 3a

6. accumulate the plant control totals into a report total. after all input records have been processed, print the report total line

7. Provide for a span of 54 lines per page. Do not permit control total lines to be printed at the top of a new page.

line spacing to be handles as follows:
single space each detail line (except 1 double spaced line between the last headin line and the first detail line on each page and 2 double spaced between the cointrol total line and the next control group
double space the department number countrol total line form the preceeding detail line
double space the plant control total line from the preceeding department number control total line
triple space the report total lione from the preceeding plant control total line


ANY HELP ANYONE CAN GIVE WITH THIS IS MUCH APPRECIATED
 
Hi,

this problem is called a level break because you have to determine groups of records with the same plant.

So only looking to your records you need something like:

perform init-program
perform until end-of-file
perform init-plant
perform employee until end-of-file or current-plant not = group-plant
perform end-plant
end-perform
perform end-program
stop run.

Besides this the size of the paper does not fit with the plant-group so you need some kind of printing routine that takes care of head-lines, amount of space used, page number, counting lines, things like that.

The printing problem is also called a boundary clash. Michael Jackson and John Cameron wrote about Jackson Structured Programming (JSP) which handles all those things.

Look this up and you learn something very valuable.

I hope this is helpful.
 
Hi Jordan,

Adding to Crox' reply, you may want to look at MIC900's post of 2/18 titled "need help with conbreaks".

I agree with Crox wholeheartedly when he stresses the importance of this exercise.
It illustrates one of the most fundamental concepts in business programming; another is the file match. These 2 probably account for 90% of batch program design. So, learning to code these efficiently and straight forwardly will make your life as a programmer a hell of a lot easier.

Good Luck,
Jack

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top