HP 3000 Manuals

Compiler-Dependent Options [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation


HP COBOL II/XL Reference Manual

Compiler-Dependent Options 

This section covers the[REV BEG] five[REV END] preprocessor commands that
are compiler-dependent.[REV BEG] This means that they are processed by
the HP COBOL II compiler.[REV END]

The compiler-dependent preprocessor commands are[REV BEG] $COPYRIGHT,[REV
END] $PAGE, $TITLE,[REV BEG] $VERSION, and $CONTROL.[REV END]
[REV BEG]

$COPYRIGHT Command 

With the $COPYRIGHT command you can put a copyright string into your
object file.

Syntax.   

     $COPYRIGHT [string [, string]...]

Parameter.   

string        the data to be placed into the object file.  The characters
              of string must be preceded and followed by a quotation
              mark.  The total number of characters used in the strings
              is limited to 116.  This includes any blanks appearing in
              strings, but does not include the quotation marks used to
              delimit the strings.

Description.   

$COPYRIGHT places the specified strings into the object file when the
program is compiled and linked.  If you have more than one $COPYRIGHT
command in your program, only the last one is used.  If multiple source
files make up a program file and there is a $COPYRIGHT for each, one
$COPYRIGHT for each source file is used.

Examples.   

The following is an example copyright string:

     $COPYRIGHT "Copyright 1991 My Company, Inc. All rights reserved."

The following shows a copyright string continued onto a second line:

     $COPYRIGHT "Copyright 1991 My Company, Inc. ",&
     $"All rights reserved."
[REV END]

$PAGE Command 

The $PAGE command allows you to replace the first line of the title
portion of the standard page heading in a listfile, and to advance to the
next logical page of the listfile.

Syntax.   

     $PAGE [string [, string]...]

Parameter.   

string        the data to be used in replacing the first line of the
              title.  The characters of string must be preceded and
              followed by a quotation mark.  The total number of
              characters used in the strings is limited to 97.  This
              includes any blanks appearing in strings, but does not
              include the quotation marks used to delimit the strings.

Description.   

The title line resulting from execution of the $PAGE command is a
concatenation of all characters in all strings used in the command, in
the order in which the strings are specified.

If no string is specified, $PAGE does not change the first line of the
title, but, if $CONTROL LIST is in effect, causes the listfile to be
advanced to the next logical page.

If the $CONTROL LIST command is in effect when the $PAGE command is
encountered, the listfile is advanced to the next logical page and the
standard page heading, including the new title, is printed, followed by
one or two blank lines, depending upon whether the title is one or two
lines long.

If the $CONTROL NOLIST command is in effect when the $PAGE command is
encountered, the first line of the title is replaced with the specified
string (or strings), but no page is advanced, and no listing of title or
text occurs.

Note that $PAGE is never listed in the listfile.

$TITLE Command 

The $TITLE command is similar to $PAGE in that it can be used to replace
the first line of a title in the listfile.  However, it can also be used
to replace the second line of the title as well as the first, or only the
second line; unlike $PAGE, it does no page advancement on the logical
page of the listfile.

Syntax.   

     $TITLE [ (n) ] [string [, string ]...]

Parameters.   

n       specifies which line of the title is to be replaced.  Thus, n can
        be either 1 or 2, and must be preceded and followed by a space.
        The default is 1.

string  has the same format, restrictions and use as in the $PAGE
        command.

Description.   

If the $TITLE command is used with no parameters, it is equivalent to
replacing the first line of the title with blanks.
[REV BEG]

$VERSION Command 

With the $VERSION command you can put a version string into your object
file.

Syntax.   

     $VERSION [string [, string]...]

Parameter.   

string        the data to be placed into the object file.  The characters
              of string must be preceded and followed by a quotation mark
              (") or an apostrophe (').  The total number of characters
              used in the strings is limited to 255.  This includes any
              blanks appearing in strings, but does not include the
              quotation marks used to delimit the strings.

Description.   

$VERSION places the specified strings into the object file when the
program is compiled and linked.  If you have more than one $VERSION
command in your program, only the last one is used.  If multiple source
files make up a program file and there is a $VERSION command for each,
one $VERSION for each source file is used.

To display the version strings from an object file or a program file, run
the program VERSION.PUB.SYS.

Examples.   

The following is an example version string:

     $VERSION "ABC Application, XYZ Company, Revision D.01.12"

The following shows a version string continued onto a second line:

     $VERSION "ABC Application, XYZ Company, ",&
     $"Revision D.01.12"

The following shows how to add the $VERSION command using the INFO string
(note the use of an apostrophe instead of a quotation mark):

     :COB85XL SRC,OBJ,$NULL;INFO="$VERSION 'REV'"
[REV END]

$CONTROL Command 

The $CONTROL command controls compilation and list options.  It has the
following format:

     $CONTROL option [ , optionlist ]

Parameters.   

optionlist       one or more valid options, each separated from the
                 preceding option by a comma and zero or more optional
                 spaces.  See Table B-2  for a complete list of
                 $CONTROL options.

option           a valid option for the $CONTROL command.  Table B-2  
                 lists all the $CONTROL options.

The following lists all the $CONTROL options:

          Table B-2.  $CONTROL Options 

ANSISORT
ANSISUB
BOUNDS
CALLINTRINSIC (1) ""
CHECKSYNTAX
CMCALL (1)  

CODE
NOCODE
CROSSREF
NOCROSSREF
DEBUG
DIFF74
DIFF74=0BS
DIFF74=INC
DYNAMIC
ERRORS=number 
INDEX16 (1)  
INDEX32 (1)  
LINES=number 
LIST
NOLIST
LOCKING
LOCOFF
LOCON
MAP
NOMAP[REV BEG]
NLS=options (1) [REV END]
MIXED
NOMIXED
OPTFEATURES=options (1)  
OPTIMIZE[=number] (1) [REV BEG]
POST85 (1) [REV END]
QUOTE=
RLFILE (1)  
RLINIT (1)  
SOURCE
NOSOURCE
STAT74
STDWARN[=level]
NOSTDWARN
SUBPROGRAM
SYMDEBUG
SYNC16
SYNC32
USLINIT
VALIDATE (1)  
NOVALIDATE (1)  
VERBS
NOVERBS
WARN
NOWARN

(1) This option is available only on HP COBOL II/XL. See Appendix H ,
MPE XL System Dependencies, for more information.

The default $CONTROL options are shown below:

     $CONTROL NOCODE, NOCROSSREF, ERRORS=100, LINES = 60, QUOTE=", LIST, LOCON, &
     $ NOMAP, MIXED, SOURCE, NOSTDWARN, NOVERBS, WARN


NOTE For a description of other $CONTROL commands, refer to "MPE XL System Dependencies" in Appendix H .
ANSISORT. This option is provided to allow you to open the files specified in the USING or GIVING clause of the SORT statement in the input or output procedure of the same SORT statement. This capability will degrade the performance of SORT statements in the program. It is also not recommended to use the USING file as an output file in the output procedure of the SORT. If you do, you will not be able to recover the data that went into the sort if the program should abnormally terminate. ANSISUB. The ANSISUB option can be seen as a combination of the DYNAMIC and SUBPROGRAM options. It determines that the expanded source code currently being compiled is to be a subprogram which strictly conforms to the ANSI standard in the following ways: 1. It can be called with the CALL identifier-1 form of the CALL statement (as with DYNAMIC). 2. It maintains values of data items from one call to the next (as with SUBPROGRAM). 3. You can use the CANCEL statement to cause subsequent calls to the subprogram to reset data items to their initial values. Refer to "MPE XL System Dependencies" in Appendix H for more information. BOUNDS. The BOUNDS option requests the compiler to generate code for both the validation of indices and subscripts and the validation of start and length for reference modification used in tables. When an invalid index is detected, the program continues to execute, enabling you to continue testing the program for other conditions. Initially, no bounds checking is enabled. This option, if used, must appear in a $CONTROL command before the PROCEDURE DIVISION is encountered. Refer to "MPE XL System Dependencies" in Appendix H for further details. CHECKSYNTAX. The CHECKSYNTAX option checks the syntax of the program without producing an object program.[REV BEG] This option can also be used to produce a complete compiler listing that lists COPYLIB modules called by the program.[REV END] CODE. [REV BEG] The CODE option requests a copy of the object code to be included.[REV END] This object code is a listing of the machine code generated by the compilation of your expanded source code.[REV BEG] This option must appear before the IDENTIFICATION DIVISION.[REV END] Refer to "MPE XL System Dependencies" in Appendix H for more information. NOCODE. [REV BEG] The NOCODE option requests that no object code be included.[REV END] NOCODE is the default. It is used to negate a previously issued $CONTROL CODE command.[REV BEG] This option must appear before the IDENTIFICATION DIVISION.[REV END] See "CODE" above. CROSSREF. The CROSSREF option of $CONTROL requests a cross reference if symbols and procedures used on the expanded source file. This cross reference is sent to the listfile. NOCROSSREF. The NOCROSSREF option of $CONTROL requests that no cross reference of symbols and labels used in the expanded source file be listed in the listfile. This is the default; thus, its use is to cancel a previously issued $CONTROL CROSSREF command. DEBUG. The DEBUG option requests that HP COBOL II generate a call in the initialization segment of your main program to the XCONTRAP intrinsic. This operating system intrinsic allows you to transfer control to Debug at any time during execution of the prepared code. To transfer control to Debug, you must press the control (CNTL) key, and while holding it down, press the Y key. DIFF74, DIFF74=OBS, and DIFF74=INC. The DIFF74 option turns on flagging of differences between the ANSI COBOL'74 and the ANSI COBOL'85 standards. Specifying DIFF74=OBS flags all obsolete features. Specifying DIFF74=INC flags incompatible features that can be detected at compile-time, as well as the obsolete features. Specifying DIFF74 has the same effect as specifying DIFF74=INC.[REV BEG] Use this option with COBOL'74 code that you want to migrate to COBOL'85. See Appendix C , "Differences Between ANSI COBOL'74 and ANSI COBOL'85" for a list of differences.[REV END] DYNAMIC. The DYNAMIC option indicates that the expanded source code currently being compiled is to be a subprogram. This or the SUBPROGRAM option must be used if you are compiling a subprogram; otherwise, the compiler assumes that the expanded source file is a main program. ERRORS=number. The ERRORS option uses an integer suboption, number, to specify the maximum number of errors to be allowed before compilation of the expanded source file is terminated. Thus, for example, if number is set to 10, then when compilation of a source file begins, it will terminate either after all records have been compiled with less than ten errors, or after the tenth compilation error has been found and listed to the listfile. LINES=number. The LINES option of the $CONTROL command allows you to define the number of lines to be written on the logical page of your listfile. For example, if the line printer is your listfile, then the command, $CONTROL LINES=30, causes thirty lines to be listed on each page of the hard copy produced by the line printer. LIST. The LIST option of the $CONTROL command enables the listing of all source text, as well as error and warning messages, subsystem initiation and completion messages, and all other listings requested by the $CONTROL command (as for example, $CONTROL MAP). Initially, this listing option is in effect by default. You might wish to use it to cancel a previously issued $CONTROL NOLIST, or $CONTROL LOCOFF command. NOLIST. The NOLIST option of $CONTROL disables the listing of source text, and all other listings requested by previous $CONTROL commands. It does not, however, disable the listing of erroneous source records, error and warning messages, and subsystem initiation and completion messages. LOCKING. This option is not required if the EXCLUSIVE and UN-EXCLUSIVE statements are used. The LOCKING option of the $CONTROL option enables dynamic locking of all files opened during the execution of your program. Note that a $CONTROL LOCKING command does not lock your file; it simply makes it possible for you to do so from within your program. LOCOFF. The LOCOFF option of $CONTROL has the same effect as the NOLIST option. Only error and warning messages, and subsystem initiation and completion messages are listed. A $CONTROL LOCOFF command remains in effect until either a $CONTROL LOCON, a $CONTROL LIST option, or the last source line is encountered. A $CONTROL LOCOFF command can be nested. LOCON. The LOCON option of the $CONTROL command negates the effect of any $CONTROL LOCOFF command issued previously. If a $CONTROL LIST command has been issued before $CONTROL LOCOFF, then a following $CONTROL LOCON restores listing of output to the listfile. If a $CONTROL NOLIST command was issued before a $CONTROL LOCOFF, then a following $CONTROL LOCON has no effect upon the listfile. $CONTROL LOCON and $CONTROL LOCOFF commands can be nested. You can use $INCLUDE to copy a file into your source file, and $CONTROL LOCOFF to suppress the listing of that file. Use $CONTROL LOCOFF as the first command and $CONTROL LOCON as the last command in the file to be copied. This suppresses the listing of the copied file and restores the listing option in effect before the $INCLUDE command was encountered. MAP. The MAP option of $CONTROL requests a symbol table map to be included in your listfile.[REV BEG] When certain compile-time errors occur, the symbol table map is not printed.[REV END] NOMAP. The NOMAP option requests that no symbol table map be included in your listfile. This is the default; thus, the purpose of the NOMAP option is to negate a previously issued $CONTROL MAP command. MIXED. The MIXED option of the $CONTROL command requests that the listfile include all preprocessor commands used in the expanded source file. Note that the $PAGE and $TITLE preprocessor commands are not listed even if this option is in effect. This option is the default; thus, if you do not wish to have preprocessor commands included as part of the listfile, you should use the NOMIXED option of the $CONTROL command. NOMIXED. The NOMIXED option of $CONTROL requests that no preprocessor commands be listed in the listfile. QUOTE = {" '}. The QUOTE option in HP COBOL II is usually not necessary. It is provided only for the purpose of defining figurative constant QUOTE and simplifying conversion from COBOL/3000 source programs (based on ANSI COBOL'68) to HP COBOL II source programs. SOURCE. The SOURCE option of $CONTROL command requests the listing of the expanded source file to the listfile. Initially, this listing option is in effect by default; however, if the input file is your terminal, this option is disabled and NOSOURCE is initially the default, unless you explicitly request SOURCE. Note that if you do request the SOURCE option while using your terminal as the input device, the result is an echoing of each line entered. NOSOURCE. The NOSOURCE option of $CONTROL disables listing of the expanded source file generated by the preprocessor. STAT74. This option allows you to specify that file status codes should be returned in the manner specified in ANSI COBOL 1974 (the way the ANSI74 entry point works) when the ANSI85 entry point is used. This allows you to use the ANSI COBOL 1985 features together with the old file status codes. STDWARN. [REV BEG] [ {HIGH }] [ {INT }] STDWARN [= {INTSG}] [ {MIN }] [ {MINDB}] [ {MINSG}] [REV END] The STDWARN option requests that the compiler detect and flag features in your source file that are part of HP COBOL II but not part of one of three levels of Federal Standard COBOL (FIPS). The three levels are minimum, intermediate, and high. The default, high, flags HP COBOL II extensions. These flagged features are listed in your listfile. STDWARN is useful in converting your HP COBOL II source program to conform to one of the three Federal Standard levels of COBOL.[REV BEG] The INTSG, MINDB, and MINSG flags are used to flag the minimum and intermediate levels of the optional modules Debug and Segmentation.[REV END] Table B-3 summarizes which of the subsets of the 12 standard COBOL modules are contained in each of the three federal levels of the language. To illustrate how to interpret the table, examine the Relative I-O module entry. When you request that your program be compared to the minimum level federal standard, any program construct using Relative I-O will be flagged, because the minimum level federal standard subset has no implementation of Relative I-O. When compared to the intermediate federal standard, which has a level 1 subset of Relative I-O, only level 2 constructs would be flagged as not being part of the intermediate federal standard. When your program is compared to the high level federal standard for COBOL, no construct utilizing Relative I-O will be flagged, because the high level federal standard contains the level 2 subset of Relative I-O.
NOTE The HP COBOL II compiler does not implement every feature of all the modules. Refer to Table 1-2 for a summary of the subunits that are implemented in HP COBOL II.
Table B-3. FIPS COBOL Subsets ---------------------------------------------------------------------- | | | | | | | Minimum | Intermediate | High | | COBOL Module | Level | Level | Level | | | | | | ---------------------------------------------------------------------- | | | | | | Nucleus | 1 | 1 | 2 | | | | | | ---------------------------------------------------------------------- | | | | | | Sequential I-O | 1 | 1 | 2 | | | | | | ---------------------------------------------------------------------- | | | | | | Relative I-O | - | 1 | 2 | | | | | | ---------------------------------------------------------------------- | | | | | | Indexed I-O | - | 1 | 2 | | | | | | ---------------------------------------------------------------------- | | | | | | Interprogram | 1 | 1 | 2 | | Communication | | | | | | | | | ---------------------------------------------------------------------- | | | | | | Sort-Merge | - | 1 | 1 | | | | | | ---------------------------------------------------------------------- | | | | | | Source Text | - | 1 | 2 | | Manipulation | | | | | | | | | ---------------------------------------------------------------------- | | | | | | Report Writer | - | - | -[REV BEG] | | | | | | ---------------------------------------------------------------------- | | | | | | Segmentation | - | 1 (1) | 2 (1) | | | | | | ---------------------------------------------------------------------- | | | | | | Debug | - | 1 (1) | - | | | | | | ---------------------------------------------------------------------- | | | | | | Communication | - | - | - | | | | | | ---------------------------------------------------------------------- | | | | | | Intrinsic Functions | - | - | 1[REV END] | | | | | | ---------------------------------------------------------------------- (1) Use INTSG, MINDB, or MINSG to flag NOSTDWARN. The NOSTDWARN option requests that the compiler not flag[REV BEG] nonstandard features of HP COBOL II. This is the default condition of the compiler. Thus, if you want to have features that are not part of Federal Standard COBOL noted,[REV END] use the $CONTROL STDWARN option. SUBPROGRAM. The SUBPROGRAM option indicates that the expanded source code currently being compiled is to be a subprogram using static storage. This option, or the DYNAMIC option, must be used when you are compiling a subprogram, because the compiler otherwise assumes the expanded source code to be the source for a main program. SYMDEBUG. The SYMDEBUG option causes the compiler to put symbolic debug[REV BEG] information into the object file for symbolic[REV END] debugging. The main program should include this option if any subprogram includes the option. Refer to the HP COBOL II/XL Programmer's Guide for more information.[REV BEG] This option must appear before the IDENTIFICATION DIVISION.[REV END] [REV BEG] The SYMDEBUG option can output symbolic debug information into the program file for the HP Symbolic Debugger/XL. See Appendix H , "MPE XL System Dependencies," for more information.[REV END]
NOTE With the SYMDEBUG option, the compiler places significantly more information in the object file.
SYNC16 and SYNC32. This option changes the alignment of SYNCHRONIZED data items. This alignment affects the number of slack bytes generated in a record. If SYNC16 is in effect, index data items and items with the SYNCHRONIZED clause are aligned along 16-bit boundaries. If SYNC32 is in effect, these items are aligned along 32-bit boundaries. This option can be used more than once in a program to align one record along 16-bit boundaries, and another record along 32-bit boundaries. Alignment cannot be changed within a record, only between records. This option is especially useful when developing files to be used on other computer architectures. For information on the default, refer to "MPE XL System Dependencies" in Appendix H . USLINIT. The USLINIT option initializes the USL file into which the compiled code is stored. This gives you a completely clear file. You should not use this option if you are compiling a source file into a USL file containing the object code of a main or subprogram to be used with the object code currently being compiled. Refer to "MPE XL System Dependencies" in Appendix H for more information. VERBS. The VERBS option of the $CONTROL command requests that the listing of statements used in the PROCEDURE DIVISION and their code offsets be listed in the listfile. [REV BEG] This option must appear before the IDENTIFICATION DIVISION. When certain compile-time errors occur, the verb map is not printed.[REV END] NOVERBS. The NOVERBS option of the $CONTROL command prohibits the listing of the verb map. See "VERBS" above. NOVERBS is the default and is used to cancel a previously issued $CONTROL VERBS command.[REV BEG] This option must appear before the IDENTIFICATION DIVISION.[REV END] WARN. The WARN option enables the flagging of possible, but not clearly, erroneous conditions within your expanded source file. These flagged conditions are listed in your listfile, along with an appropriate warning message. WARN is a default condition. Thus, you need only use it to negate the use of a previously issued $CONTROL NOWARN command. NOWARN. The NOWARN option disables the flagging and listing of possible erroneous conditions and their associated warning messages.


MPE/iX 5.0 Documentation