79124854

Date: 2024-10-25 08:30:48
Score: 0.5
Natty:
Report link

it would be fine to see some lines in both files to understand better the problem.

Meanwhile, the explanation is:

in your actual code, POLICY-NUMBER is getting value just when EOF is reached and POLICY-IN is numeric. Otherwise, the program will perform 400 paragraph (POLICE-NUMBER <> 99) and will raise an exception when moving POLICY-IN to POLICY-OUT if its not numeric.

You can discard the variable POLICY-NUMBER and test if WS-END-OF-JOB = Y after invoking 300 paragraph to decide performing 400 paragraph or not, but be aware you are using the same flag in both 300 and 400 paragraphs to control different files.

If your input file may contain non numeric values, you should test it before moving POLICY-IN to POLICY-OUT and decide if you will use it or advancing to next record.

In adittion, it seems you want to treat records in the second file (paragraph 400) until POLICY-FILE-IN gets a different value from POLICY-IN, but there is nothing in that way.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Rui Vieira