COBOL Assignment Question
Packed Decimal:
Show the numeric EDCDIC bit code for the following numbers:
- 8
- 24
- 127
- 78
- 518
Show the COMP-3 bit codes for these values including the proper sign code:
- + 2
- +21
- +145
- -68
- -271
How many bytes will these PIC COMP-3 fields require?
- PIC S9(4)V9
- PIC S9V9
- PIC S9(8)V9(4)
- PIC S999V99
- PIC S9(6)
Code the COBOL SORT command to
- Accomplish sorting a file for input to the following three scenarios which are on the next three pages.
- Use the file names of IN-FILE, WORK-FILE, SORT-FILE, and
- Make up variable names as needed with the prefixes of IN-, WRK-, and SRT-.
Example:
If the input file has this description:
And the report description lists the employees alphabetical within descending rate values
I would need to sort the file like this:
SORT WORK-FILE
ON DESCENDING WRK-RATE
ASCENDING WRK-LAST WRK-FIRST
USING IN-FILE
GIVING SORT-FILE
Scenario One:
Using this input file:
And this report description that list employees alphabetical within hire date:
Code a SORT command to support the requirements.
Scenario Two
Using this input file:
And this report description that lists students alphabetical within average. The averages are listed from high to low.
Code a SORT command to support the requirements.
Scenario Three
Using this input file
And this report description that lists the information in chronological order by order date and grouped by salesperson number.
Code a SORT command to support the requirements.
Using COBOL syntax, code the entire Process-Record module of a program for the three scenarios on the next three pages.
Include the processing elements necessary per the report layout and specifications in the Scenario.
EXAMPLE:
If a program was needed that exemplified the typical processing and produced a typical report, this is what is needed:
Hint: Remember, the logic model in XAD for the typical Process-Record module looks like the following. You are to convert the XAD to COBOL code.
ProcessRecord Read command DetailLineCalculation TotalLineAccumulation Detail Line
200-Process.
Read In-file
At end
Move “yes” to eof-sw
Not at end
Perform 210-det-calc
Perform 220-accum
Perform 230-detail
End-read
Scenario One
Use the reporting requirements of Scenario One on page 3.
Scenario Two
Use the reporting requirements of Scenario Three on page 5.
Scenario Three
With this as the input file:
And this as the report description:
Code the Process-Record module, validating that both first and last name fields contain data and that the grade point and semester credit hour fields contain numeric, positive values. Should any error be found, cause the logic to write out an error message to a second report.