Highlighted
Absent Member.
Absent Member.
611 views

i-o-control statement error.

Jump to solution

I have a piece of code which have been running fine in Net Express. When compiling the same in visual COBOL for IDE I am getting some error.

 

The error are : 

COBCH0071S PROCEDURE DIVISION missing or unknown statement

and

COBCH0082S COBOL Division or Section header encountered in incorrect order

 

Below is the part of the code with the lines highlighted which is giving me error.

 

file-control.
001100 select temp-b-sec-in-file assign to ut-s-insort.
001100 select sort-file assign to ut-s-sortwk01.
001200 select temp-b-sec-out-file assign to ut-s-outsort.
006900 i-o-control.
007000 apply write-only on temp-b-sec-out-file.
002700 data division.
002800 file section.
012400 fd temp-b-sec-in-file
012500 recording mode is v
012600 block contains 0 records
012700 record contains 202 to 30704 characters
012800 label records are standard
012900 data records are temp-b-sec-rec-in-a,
013000 temp-b-sec-rec-in-b.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: i-o-control statement error.

Jump to solution
It also seems like the compiler allows APPLY WRITE-ONLY for all mainframe dialects not just OSVS, so maybe setting ENTCOBOL or something more up-to-date might be more appropriate than OSVS. It looks like there are other APPLY options which are OSVS only but not WRITE_ONLY.

You should really check the list of NX directives you were turning on to ensure you are using the same set in VC.

View solution in original post

5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: i-o-control statement error.

Jump to solution

If you look in the Visual COBOL documentation in the COBOL Reference manual for I-O-control here you will see that the APPLY statement is marked as being supported in the OSVS dialect.

This means that you are most likely using a different set of compiler directives for Visual COBOL than you were for Net Express. Try adding the DIALECT"OSVS" to the set of Visual COBOL directives but in order to ensure maximum compatibility between the two products you should use the exact same set of directives.

Highlighted
Absent Member.
Absent Member.

RE: i-o-control statement error.

Jump to solution
Hi Chris,

Thank you for the quick reply.
The dialect set is Micro Focus and not OSVS.

When I go ahead and change the dialect to OSVS then it seeks code in native cobol format i.e. it looks for everything in upper case character. Is there anyway out to deal with this where-in I can change the dialect to OSVS but the compilation happens successfully without rewriting the code in upper-case.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: i-o-control statement error.

Jump to solution
Try setting the OSVS directive instead of the DIALECT"OSVS". That tells the compiler to recognize OSVS features but does not enforce the full OSVS dialect.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: i-o-control statement error.

Jump to solution
It also seems like the compiler allows APPLY WRITE-ONLY for all mainframe dialects not just OSVS, so maybe setting ENTCOBOL or something more up-to-date might be more appropriate than OSVS. It looks like there are other APPLY options which are OSVS only but not WRITE_ONLY.

You should really check the list of NX directives you were turning on to ensure you are using the same set in VC.

View solution in original post

Highlighted
Absent Member.
Absent Member.

RE: i-o-control statement error.

Jump to solution
Thank you so much Chris.
ENTCOBOL as directive really solved my problem. Now all the codes are getting compiled successfully like a warm knife through a slab of butter. 🙂 🙂
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.