/STANDARD[(=option,...)] /STANDARD=85 (D) Controls whether the compiler generates code according to either the ANSI 1974 or 1985 COBOL standard and produces informational messages associated with specific language features. To receive these informational messages, you must also specify /WARNINGS=ALL or /WARNINGS=INFORMATIONAL. You can select one or more of the following options: 85 Produces code according to the 1985 ANSI standard for certain constructs. The default is /STANDARD=85. [NO]V3 Produces code in the manner of version 3.4 of VAX COBOL in specific instances, and issues informational messages for language constructs that would cause different run-time results if /STANDARD=85 had been specified. The default is NOV3. [NO]SYNTAX Produces informational diagnostics on language features that point out HP extensions to the ANSI 1985 COBOL Standard. The default is NOSYNTAX. [NO]XOPEN Produces code for the ASSIGN clause and default file-sharing behavior in the manner of the X/Open CAE specification for the COBOL language. The default is NOXOPEN. [NO]MIA Issue informational diagnostics for the language elements which do not conform to the MIA (Multivendor Integration Architecture). The default is NOMIA. VSI COBOL is based on the ANSI 1985 COBOL standard. As such, VSI COBOL provides full support for the /STANDARD=85 qualifier option as well as support for some features of the /STANDARD=V3 qualifier option that were available with VAX COBOL Version 4.0 and higher. For information about the HP COBOL for OpenVMS VAX implementation of the /STANDARD=V3 qualifier option, see the COBOL User Manual. When you specify /STANDARD=V3 in the following specific instances, VSI COBOL exhibits behavior that is consistent with the ANSI 1985 COBOL standard: . When evaluating subscripts in STRING, UNSTRING, INSPECT (Format 3), and the REMAINDER phrase of the DIVIDE statement. . When evaluating reference modification in STRING, UNSTRING, and INSPECT (Format 3) statements. . When evaluating the order of identifiers in some PERFORM (Format 4) statements. . When interpreting PIC P items in some move and comparison operations. . When determining the size of variable-length tables in some MOVE statements. When you specify /STANDARD=V3 in the following four specific instances, VSI COBOL exhibits behavior that is identical to the VAX COBOL Version 4.0 and higher behavior, when specifying /STANDARD=V3: a. EXIT PROGRAM statement in a main program If you specify /STANDARD=V3, the compiler treats an EXIT PROGRAM statement as a return in both main programs and subprograms. Specify /STANDARD=85 to bypass an EXIT PROGRAM statement in the body of a main program and execute the statements following the EXIT PROGRAM statement. If the program is a subprogram, the EXIT PROGRAM statement acts as a return to the program that called the subprogram. b. I-O file status values If you specify /STANDARD=V3, you receive the file status values listed in the left-hand column, labeled V3. If you specify /STANDARD=85, you receive the file status values listed in the right-hand column, labeled 85. The following table explains the I-O error conditions and lists the corresponding file status values for the /STANDARD qualifier using the V3 and 85 options. __________________________________________________________________ I-O File Status Values for the /STANDARD Qualifier __________________________________________________________________ I-O Error Condition Status Value ________________________ V3 85 __________________________________________________________________ READ successful -- detected alternate duplicate key. 00 02 READ successful -- record shorter than fixed file attribute. 00 04 CLOSE reel/unit attempted on nonreel/unit device. 00 07 READ fails -- relative key digits exceed relative key. 00 14 WRITE fails -- relative key digits exceed relative key. 00 24 OPEN I-O on file that is not mass storage. 00 37 WRITE fails -- attempt to write a record of a different size than in the file description. 00 44 READ fails -- no next logical record (EOF detected). 13 10 READ fails -- no next logical record (EOF on OPTIONAL file). 15 10 READ fails -- no valid next record (already at EOF). 16 10 READ NEXT or sequential READ -- no valid next record pointer. 16 46 READ or START fails -- optional input file not present. 25 23 READ successful -- record longer than fixed file attribute. 30 04 OPEN on relative or indexed file that is not mass storage. 30 37 REWRITE fails -- attempt to rewrite record of different size. 30 44 CLOSE fails -- file not currently open. 94 42 DELETE or REWRITE fails -- previous I-O not successful READ. 93 43 OPEN fails -- file previously closed with LOCK. 94 38 OPEN fails -- file created with different organization. 94 39 OPEN fails -- file created with different prime record key. 94 39 OPEN fails -- file created with different alternate record keys. 94 39 OPEN fails -- file currently open. 94 41 READ or START fails -- file not opened INPUT or I-O. 94 47 WRITE fails -- file not opened OUTPUT, EXTEND, or I-O. 94 48 DELETE or REWRITE fails -- file not opened I-O. 94 49 OPEN INPUT on a nonoptional file -- file not found. 97 35 __________________________________________________________________ c. No Valid Next Record condition If all of the following conditions exist: . The no valid next record (NVNR) condition exists. . Your program attempts a sequential READ statement. . Your program includes an AT END branch associated with the READ statement. And if you specify /STANDARD=V3, the following occurs: 1. The file status variable, if any, for the file is set to 16. 2. The statements associated with the AT END statement are executed. 3. The program continues to execute normally. If you specify /STANDARD=85, the following occurs: 1. The file status variable, if any, for the file is set to 46. 2. The statements associated with the AT END statement are not executed. 3. The program terminates execution abnormally (unless you have provided for this situation with a Declaratives USE AFTER STANDARD EXCEPTION procedure). d. Opening nonoptional files in OPEN I-O and EXTEND modes If you specify /STANDARD=V3, the compiler creates nonoptional files opened in I-O or EXTEND mode, if the file is unavailable. If you specify /STANDARD=85, the compiler does not create nonoptional files opened in I-O or EXTEND mode if the file is unavailable; instead, the I/O system issues a run-time error. Specifying /STANDARD=V3 with the /FIPS=74 qualifier instructs the compiler to produce code according to the 1974 ANSI standard for certain constructs that are supported by the Federal Information Processing Standards Publication 21--1 (FIPS-PUB 21--1), issued by the U.S. National Bureau of Standards, interpretation of file status. Specifying /STANDARD=V3 with the /NOFIPS qualifier ensures version to version compatibility for COBOL. Specifying /STANDARD=SYNTAX with the /WARNINGS=ALL qualifier instructs the compiler to produce and print informational messages on language features that point out HP extensions to the ANSI 1985 COBOL Standard. Specifying /STANDARD=MIA with the /WARNINGS=ALL qualifier instructs the compiler to produce and print informational messages on language features that point out langauges element which do not conform to the MIA specifications: . HP syntax extensions from base standards (ANSI-85, JIS-88) . Two of four optional modules . All obsolete language elements of required modules in base standards . Language elements omitted from required modules in base standards due to the different implementation of the vendors . HP specific Japanese features out of MIA extension elements related to Japanese Not specifying /STANDARD or specifying /STANDARD, /NOSTANDARD, /STANDARD=(85,NOV3,NOSYNTAX,NOXOPEN,NOMIA), or /STANDARD=(NO85,NOV3,NOSYNTAX,NOXOPEN,NOMIA) is equivalent to specifying /STANDARD=85.