View previous topic :: View next topic
|
Author |
Message |
Sasi Kiran Patha Warnings : 2 New User
Joined: 19 Nov 2006 Posts: 73 Location: Hyederabad
|
|
|
|
Hi,
I have a 2 cobol programs say A and B and A calls B.
"A" has the SORT input and output procedures. "B" is called from "A"
both in input and output procedures. "B" prints a file.
We have to convert COBOL program to COBOL/370 program.
Both the versions execute sucessfully but the output files are not the
same.
when We put Display statement while executing COBOL/370 version,
we found the print record display pattern in the sysout does not match output file's records order.
In the output file a record is repeated at the end many times.
we find no repetition in the sysout.
The cobol version output file did not have the record repetition.
hope i explained reasonably... what could be the reason.
Any sugesstions
the sort statement in "A".
SORT SORTFILE
ASCENDING AS-COMPANY-CODE, SORT-WORK-KEY, AS-OFFICE-NO
INPUT PROCEDURE ACCTS-REC-BRANCH-REPORT
OUTPUT PROCEDURE ACCTS-REC-SUMMARY-REPORT
Regards,
Sasi Patha. |
|
Back to top |
|
|
tangentray
New User
Joined: 30 Dec 2006 Posts: 20 Location: Kolkata, India
|
|
|
|
It will be mere speculation rather than conclusion to comment anything at this point without looking in greater detail.
I cannot understand how it is possible that the order in which you are getting the displays vary from the order in which you are getting in the ouput file provided you have given the displays in your output procedure after the RELEASE statement.
If the order is not same in the 2 versions that you have, that might be because the keys are beaing read differently in the 2 versions. I will suggest you display the keys to find out that they are being read rightly.
The problem of repetation of last rcord is normally due to erroneous looping. But in this case assuming that you have no looping since you are directly writing in the output procedue, it might happen due to erroneous sorting as well. I will suggest that make sure that the keys are same and correct. |
|
Back to top |
|
|
Sasi Kiran Patha Warnings : 2 New User
Joined: 19 Nov 2006 Posts: 73 Location: Hyederabad
|
|
|
|
Hi,
Thanq. I understand granular details are needed :-).
Its 1st time i come accross sort procedure in our shop.
The DISPLAY order varies with output file record order even with
COBOL version.
The only changes we made to convert the program into COBOL/370
is changing positioning verb to advancing verb in Program "B".
We did not make any changes to loops or sort. The RELEASE
statement is in progrma A and the file is printed in program B.
We put diaplay statement just before writing the file.
One record is repeated at the end of the report in the output file
for COBOL/370 version execution, this repetition is not in corresponding SYSOUT. Hence i ruled out chances of an erraneous loop.
How do i check if SORT is behaving differently in COBOL/370 version.
The SYSOUT of COBOL and COBOL/370 are same.
The sort work key is combination of:
ACCT-SUM-REGION PIC X.
ACCT-SUM-DIVISION PIC X.
ACCT-SUM-AREA PIC X.
ACCT-SUM-DIST PIC X.
One more observation which might be helpful to us is:
The print-rec is not initialized after the write advancing,
its source print-line is initialized.
There can be a case when the write para is performed
without any write statement executed, i.e print-rec is populated from print-line and printed only if conditions are met.
Regards,
Sasi Patha. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Sasi Kiran Patha wrote: |
The only changes we made to convert the program into COBOL/370 is changing positioning verb to advancing verb in Program "B". |
Your problem is there, but I haven't found a manual old enough to remind me of the rules for positioning vs advancing.... |
|
Back to top |
|
|
Sasi Kiran Patha Warnings : 2 New User
Joined: 19 Nov 2006 Posts: 73 Location: Hyederabad
|
|
|
|
Hi thank u all for timely replies.
The issue was solved.. It was a coding mistake, unfortunately output files'
data tempted us to think differently.
The writing of print-rec for file in one of the conditions in program B should have been print-rec9 of another file in the program B. Corrected
print-rec to print-rec9.
Sorry.
regards,
Sasi Patha. |
|
Back to top |
|
|
|