Cobol compile options

Cobol compile options DEFAULT

Compiler Options

-#
Provides information on how the Compiler and linker would be invoked without actually invoking them. This option also shows which UNIX options are translated to Micro Focus options; for example, when the standard UNIX -O option is given on the driver command line, it is translated on the Compiler invocation line as -opt.
-adt
-adt

Generates a file containing the data structures processed by the PL/I compiler. If adt-filename is not specified, a file with the name program-name.adt is generated. This file is consumed by the Record/Segment Layout Editor, which creates Segment Layout Files (SLF) and Record Layout Files (STR) using these PL/I structure descriptions. Data File Tools can then use these layout files to aid in processing/editing the segments or records (Data File Convert, Data File Editor, IMS Database Editor, IMS Database loader).

Use the ADT file with the Layout Editor to create SLF and STR files.

-agginit
Performs initialization of aggregates compatible with 7.x versions of Open PL/I (scalar arrays only).

Example:

dcl myarr(4) fixed bin(31) static init (1); put skip list (myarr); results in: 1 1 1 1

By default, without -agginit, only the first element is initialized.

-ascii
Specifies to use the ASCII character encoding for all character data. This option is set by default.
-bigendian
Specifies that all FIXED BINARY, CHARACTER VARYING, GRAPHIC VARYING and WIDECHAR VARYING items are implicitly declared with the BIGENDIAN data attribute, unless the NATIVE attribute is explicitly applied to a data item.
-bitsltr
Stores bit strings left-to-right within each byte. This is similar to Big Endian bit ordering (Intel only). The Intel default is to store bit strings right-to-left, but when the option is used, bit strings are stored left-to-right within each byte.
-c
Suppresses linking and produces a relocatable object file. This option applies to mfplx only.
-cics
Invokes the CICS preprocessor for EXEC CICS support. This allows EXEC CICS statements to be recognized and processed to generate native PL/I source code.
-coffdebug
Emits line number information for the Visual Studio debugger to enable breakpoints, statement tracing, and call stack information of Open PL/I source code.
Restriction:
  • Evaluation of variables is not supported.
  • -coffdebug is not supported on bit Windows.
-compact_msgs
Do not break the line for messages.
-currency_symbol
Allows an alternate currency symbol for picture specification. It can take a character, decimal number, or hex constant of the form 0xDD, for example, -currency_symbol £, -currency_symbol , -currency_symbol 0xa3.
-db2
Invokes the DB2 preprocessor, mfdb2. The default DB2 preprocessor output file name is .pp2, where is the name of the source file. If the -ppdb2 option is not specified, the file .pp2 is deleted after the compilation phase is completed. The -db2 option applies to mfplx only.

Warning: This option is required for the mfdb2 preprocessor, which is deprecated. Please use the EXEC preprocessor (invoked by -sql db2)

-deb (-debug)
Produces debugging information for CodeWatch, Micro Focus's source-level debugger. You must specify this option when using CodeWatch to debug source. When using -deb, you may specify only optimization levels 1 or 2. The default is -opt 2.
-default_binary
Causes the BINARY attribute to be assumed if the FIXED attribute is specified without BINARY or DECIMAL.
-default_decimal 
Causes the DECIMAL attribute to be assumed if the FIXED attribute is specified without BINARY or DECIMAL. This option is the Compiler default.
-defext
Causes external variables to be defined in the data section. You must use this option for programs using external files.

The -defext option causes the initialized values of STATIC EXTERNAL variables and external file constants to be defined. Each STATIC EXTERNAL variable that has an INITIAL value must be declared in one and only one module that has been compiled with -defext. Failure to do so causes the INITIAL value to have no effect. The default is -nodefext.

Also, each file constant must be declared in one and only one module that has been compiled with -defext. When -defext is used, file attributes specified in the file declaration merges with attributes specified when the file opens. This is critical when doing VSAM/INDEXED I/O.

-dli
Invokes the DL/I preprocessor for EXEC DLI support. This allows EXEC DLI statements to be recognized and processed to generate native PL/I source code. This option is processed and supported by the EXEC preprocessor (EXEC PP).
-dll
Generates an object that can be used as a fetchable procedure. Use -dll to build shared fetchable procedure objects based on your operating system.
-E
Causes any specified preprocessors (-macro, -db2) to be run on the source file, and saves their output, but stops without running the Compiler.
-ebcdic
Specifies to use EBCDIC character encoding for all character data.

Note: The WIDECHAR and GRAPHIC data types are not supported with the -ebcdic compiler option.

-err_on_stdout
Displays or prints compiler error messages to STDOUT instead of STDERR.
-exp
Produces an expanded listing of the generated code in the form of assembly language statements in the listing file.
-f
Synonymous with -flag.
-fb7asfb15
Treats Fixed Binary (7) as Fixed Binary (15). Use for backward compatibility with previous versions of Open PL/I.
-fbmaxp
Specifies the maximum Fixed Binary precision. The values can be:
31
Sets the maximum Fixed Binary precision to This is the Open PL/I default.
63
Sets the maximum Fixed Binary precision to 63 and enables Fixed Binary (63) support.

You can also use -fixed_bin_max_p as a synonym to -fbmaxp.

-fdasfb
Causes Float Decimal data to be internally coded as Float Binary. This option produces much faster code but loses precision in the least significant digits of arithmetic results. -fdasfb is the default. See also the -nofdasfb option.
-fdmaxp
Specifies the maximum FIXED DECIMAL precision . Recommended values are:
15
The z/OS default.
18
Open PL/I default for Enterprise Developer release and earlier.
31
Open PL/I default for Enterprise Developer release and later.

Fixed decimal precision 31 is the maximum allowed.

You can also use -fixed_dec_max_p as a synonym to -fdmaxp.

-fixed_bin_max_p
The same as -fbmaxp.
-fixed_dec_max_p
The same as -fdmaxp.
-flag
Specifies the minimum diagnostic level of messages. Diagnostics below this level are suppressed. Synonymous with -f. -flag The minimum diagnostic level can be:
I
Emits diagnostic messages beginning at the Informational level (Lists all messages. This is the default).
W
Emits diagnostic messages beginning at the Warning level.
E
Emits diagnostic messages beginning at the Error level.
S
Emits diagnostic messages beginning at the Severe level.
-fmaxp
Causes floating-point precision to be used for the trigonometric built-ins and for the following arithmetic built-ins: EXP, LOG, LOG10, LOG2, SQRT. -fmaxp is the default. Use -nofmaxp for the standard PL/I conversion rules for the trigonometric and the named arithmetic built-ins.
-fpcobol
Tells the Compiler to generate code compatible with COBOL handling of floating-point parameters.
-full_list
Tells the macro preprocessor to omit %NOLIST directives normally placed before code included by the %INCLUDE statement, thereby allowing the included code to be visible in the compilation listing.
-graphic
Enables support for the GRAPHIC data type.

Note: EBCDIC data and constants in conjunction with -graphic is not supported .

-help
Prints out a list of available compiler options to the console or STDOUT output, and to EXIT.
-highbif
This option allows changing the value returned by the HIGH() built-in function. For example, -highbif (the default value is ; the value may be used for compatibility with earlier versions of Open PL/I).
-incl
Invokes the Include preprocessor which will process selected or default include statements and produce a deck that may then be treated as a single source file by another preprocessor or the Open PL/I Compiler.
-ipath
Directs the Compiler to search specified directories for files to be included in the source program text by use of the %INCLUDE statement. is an ordered list of directories of the form dirname[:dirname]

The -ipath option instructs the Compiler to use these directories in the specified order in its search for files to satisfy %INCLUDE statements (except in cases where an absolute directory path is specified in the %INCLUDE statement).

For example, suppose the source program contains:

%INCLUDE partlist;

and the Compiler invocation command is:

mfplx -ipath .:/u/libr1:/u/libr2

In this case, the Compiler will first search for "PARTLIST" in the current working directory, then /u/ libr1, and finally /u/ libr2. If that fails, it will search for "partlist" (lowercase) in the same directories.

In a Windows environment, the equivalent Compiler invocation is:

mfplx -ipath .;drive:\libr1;drive:\libr2
-ipubr
Causes bits for unsigned integers created using INT or POSINT and bit strings returned with UNSPEC to be inversed.
-isuffix
Causes to be appended to the filename specified in %INCLUDE statements, except those in which the quoted filename form of the %INCLUDE statement is used.

For example, suppose the source program contains:

%INCLUDE partlist;

and the Compiler invocation command is:

mfplx -isuffix .INC

In this case, the Compiler searches for a file named partlist.inc.

-l [ ]
Produces a Compiler listing where is the name of the file to which the listing is output. If you do not supply a filename, you must place this option after the source filename on the command line; otherwise, an error message appears. The default name of the file containing the listing is .list, where is the source filename (excluding the pathname) up to, but not including, the last "." (if any) in the name. For example, if the source filename is prog.pl1, the default listing is prog.list (prog.lst for Windows systems). A Compiler listing is produced by default whenever -exp, -map, or -xref is specified.
-laxbased
Disables storage checking of BASED variables. This is Open PL/I default. See also –nolaxbased.
-laxdefined
Disables type and storage checking of DEFINED variables. This is Open PL/I default. See also –nolaxdefined.
-laxinit
Disables dependency ordering of automatic initializers in block prologue. The declaration order is used.
-longint
Changes the default precision of Fixed Binary variables from (15) to (31).
-lowercase
Converts all uppercase names of internal and external variables and constants to lowercase.
-macro
Invokes the Open PL/I Macro Preprocessor, mfpp. The default preprocessor output file name is .pp, where is the name of the source file. If the -pp option is not specified, the .pp file is deleted after the compilation phase is completed. The -macro option applies to mfplx only.
-map
Produces a storage allocation map at the end of the listing file.
-map
Does one of the following:
  • When used without a colon or any arguments, -map produces a storage allocation map at the end of the listing file.
  • When used with a colon and an argument, for example -map: (where is the filename of a linker map file), this option passes to ldpli and to generate a linker map for the specified filename.

-map add -map: can be used together.

-margins
Sets the margins within which characters of the source file are interpreted as source code and outside which all characters are ignored by the Compiler. is the column number of the leftmost character, and is the column number of the rightmost character to be interpreted as source code. Note that if tabs are used, each tab is counted as a single character. The -margins option can be overridden by a *PROCESS statement in the source.

Note: There must be no spaces around the comma separating the left and right margin.

-maxmsg
Specifies the maximum number of diagnostics of a specified severity or higher which will be produced during compilation. -maxmsg ,

where is one of I, W, E, S as follows:

I
Counts all compiler messages starting at I-level (Informational) against the maximum.
W
Counts all compiler messages starting at W-level (Warning) against the maximum.
E
Counts all compiler messages starting at E-level (Error) against the maximum.
S
Counts only S-level (Severe) against the maximum.
n

The maximum number.

The default is .

Compilation terminates if the number of messages exceeds the maximum number allowed. If messages are below the specified severity, they are not counted in the number. The value of can range from 0 to If you specify 0, the compilation terminates when the first error of the specified severity is encountered.

An unrecoverable A-level (Abort) error message always results in termination.

-names
Adds extralingual characters to identifiers via the compiler options, similar in nature to *PROCESS NAMES().

Example:

-names 'string1' [ 'string2' ]
string1
Extralingual characters to add to identifier.
string2

Corresponding upper case characters. Optional.

The default is:

-names '[email protected]#' '[email protected]#'

For additional characters you must specify the default or subset if desired, plus the additional lingual characters.

-names '[email protected]#Ј'

For convenience, hex constants of the form are accepted in place of the strings above.

-names 0xa3
-nest
Causes the nesting of DO END, PROC END, and so on to be shown in the listing file. See the -l option for more information about the listing file.
-nocicsdebug
Allows use of CodeWatch to debug the original source file, rather than the intermediate file generated by the CICS preprocessor. Also, causes Compiler diagnostics to use line numbers referencing the original source file. This is the default. The -nocicsdebug command applies to mfplx and kixplt only.
-nodebuginfo
Tells the Compiler to not break the line for %FILE and %LINE information.
-nodefext

The -nodefext option prevents definition of initialized values of STATIC EXTERNAL variables and external file constants (default). See the -defext compiler option for more information.

Also, each file constant must be declared in one and only one module that has been compiled with -defext. When -defext is used, file attributes specified in the file declaration will be merged with attributes specified when the file is opened. This is critical when doing VSAM/INDEXED I/O.

-nofdasfb
Causes Float Decimal data to be internally coded as Binary Coded Decimal. The default setting is -fdasfb.
-nofmaxp
Causes standard PL/I conversion rules to be used to determine the precision of trigonometric and certain arithmetic built-ins. The default is -fmaxp.
-noincludes
Tells the Compiler and/or macro preprocessor not to include the contents of %INCLUDE files in the compiled source.
-nolaxbased
For BASED variables declared using the form BASED (ADDR(x), enables storage checking with the base reference “x”. –laxbased is the Open PL/I default.

Note: Any of the options -cics, -sql, -dli, -mvs, and/or –ims imply –nolaxbased. This can be overridden when used in combination with –laxbased.

Example:

DCL S1 CHAR(10); DECLARE S2 CHAR(20) DEFINED (S1);

will result in an appropriate diagnostic.

-nolaxdefined
For DEFINED variables, enables both type and storage checking on DEFINED variable and the base variable. –laxdefined is the Open PL/I default.

Note: Any of the options -cics, -sql, -dli, -mvs, and/or –ims imply –nolaxdefined. This can be overridden when used in combination with –laxdefined.

Example:

DCL X FIXED BIN (15); DECLARE Y FIXED BIN (31) BASED (ADDR(X));

will result in an appropriate diagnostic.

-nolaxdcl
Tells the Compiler to not allow compiler declarations for undeclared variables.
-nolaxinit
Enables dependency ordering of automatic initializers in block prologue. This is the Open PL/I default.
-nomacro
Suppresses the invocation of the Open PL/I Macro Preprocessor. The default is -nomacro.
-noobj
Compiles for syntax and semantic checking only. Does not produce an object file.
-noopt
Compiles without optimization. This is the default.
-norange
Suppresses generation of code to check the validity of subscript references and substring bounds. This option should be used after your program has been debugged to improve execution time performance. The default is -norange.
-noopt
Compiles without optimization. This is the default.
-not_symbol
Lets you specify an alternate NOT symbol. It can take a character, decimal number, or hex constant of the form 0xDD. See also %PROCESS in the Language Reference Manual.
-nounixdebug
Avoids generating the additional object file data needed to report source file and line number when a fatal run-time error occurs, or for use by the ONLOC built-in function.
-nounrefexternals
Prevents external entry symbols that are not referenced in the program from being generated in the object file. This is the default.
-nowarn
Suppresses all INFORMATIONAL and WARNING level diagnostics. This is equivalent to setting the –flag option to .
-[no]xref
Tells the compiler to not include a cross-reference table of names that are used in the program. See the -xref compiler option for more information.
-O
Invokes the optimization phase of the Compiler. This option applies to mfplx only and is equivalent to the -opt option.
-o
Names the object file the name you specify with . If -o is not specified, the default name of the file is .o, where is the source filename up to, but not including, the last "." (if any) in the name. For example, if the source filename is prog.pl1, the default object filename is prog.o (prog.obj for Windows).

If -c is specified, the -o option is passed to the compiler; if -c is not specified, -o is passed to ldpli.

-opt
Specifies the level of optimization by the Open PL/I Compiler, where stands for the level (1 – 3) of optimization. The default setting is -noopt. If is not included, the program is optimized at level 3. If -deb is specified, -opt 2 is the maximum level allowed. Note, -opt-deb is equivalent to -opt 2 -deb.
-optcics
Allows the CICS options to be passed to the CICS ECM
-optdli
Allows the DL/I options to be passed to the DL/I (IMS) ECM
-optexec
Lets you specify options for the EXEC preprocessor. You can use the following for the -optexec option.
[NO]PLITEST
Tells the EXEC preprocessor to inject an automatic call to start the GUI CodeWatch debugger.

Using the -optexec option with the PLITEST parameter also lets you debug PL/I programs that run under CICS. During execution, the program stops at the first executable statement (either the PROCEDURE statement or the first statement following the PROCEDURE statement, depending on the execution environment). Specify the appropriate program source files and debug files with the and environment variables when using PLITEST with this option.

NEWNAME(newname)
Specifies a name for the outermost external procedure in addition to other names that may have been specified on the PROCEDURE statement. Use this when the name on the procedure does not match the name of the executable. (newname) is the same name as the name of the executable.
trace
Causes the preprocessor to create a file source.trc where is the name of your source file.
ctrace
Creates a trace file for submission to Technical Support if requested.
strace
Creates a log file from the internal functions called by the program.
vtrace
Creates a dynamic visual trace of the program.
-optsql
Allows the SQL options to be passed to the SQL ECM
-or_symbol
Lets you specify an alternate OR symbol. It can take a character, decimal number, or hex constant of the form 0xDD. See also %PROCESS in the Language Reference Manual.
-pass
Connects to a remote DB2 database. You can use this option with a specified username and password. The format is: –pass .

Where is the username and is the password for the remote DB2 connection. mfplx first checks the -pass for a username/password and uses these values if specified. If not specified, it uses the values set for the and environment variables.

-pic
Generates position-independent code, suitable for linking into a shared library. This option is only available on Solaris, SUSE Linux and Red Hat Linux.
Use this option when compiling code for inclusion in a shared object.
-pl1g
Causes Open PL/I to retain the behavior of releases prior to Open PL/I for certain operations that have been changed in such a way as to become incompatible with that former behavior. For example, TIME() returns a value including three fractional digits (thousandths), but -pl1g causes it to return only two fractional digits (hundredths).
-plitdli

Specifies IMS linkage when calling a PLITDLI entry point name rather than a user supplied PLITDLI. This option allows for declared as such in the user program (without an entry descriptor list and/or return type).

-pp
Specifies the file name for the output file of the Open PL/I Macro Preprocessor. An output file created with the -pp option is preserved after the compilation phase is completed. This option applies to mfplx and mfpp only.
-ppcics
Specifies the file name for the output of the CICS preprocessor. An output file created with the -ppcics option is preserved after the compilation phase is completed. This option applies to mfplx only.
-ppdli
Specifies the file name for the output of the DL/I preprocessor. An output file created with the -ppdli option is preserved for consumption by a downstream preprocessor or the PL/I compiler.
-ppdb2
Specifies the file name for the output of the DB2 preprocessor. An output file created with the -ppdb2 option is preserved after the compilation phase is completed. This option applies to mfplx only.
-ppsql
Specifies the file name for the output of the SQL preprocessor. An output file created with the -ppsql option is preserved after the compilation phase is completed. This option applies to mfplx only.
-proto
Provides more extensive prototype checking on arguments vs. parameters in entry declarations (also assumed by default when using -vax).

Example:

declare myproc external entry( fixed binary(31), fixed binary(15), fixed binary(15)); myproc: procedure(a,b,c); /* mismatch diagnosed, -proto and -vax */ declare a fixed binary(15); declare b fixed binary(15); declare c fixed binary(15); end t;
-range
Validates all static array bound references at compilation time, and generates code to check the run time validity of all subscript references, and substring bounds. Note that the checking code slows down execution time performance.

Exceeding array or string bounds at run time, raise either the SUBSCRIPTRANGE or STRINGRANGE conditions as appropriate. Use this option to debug programming errors relating to subscripts and substrings. Use the -norange option for debugged code. The default is -norange.

-rc
Specifies the maximum error code level which will result in a zero return code from mfplx. The default is –rc 4,0. The allowed values are:
The compiler error code levels and mfplx return codes are shown in the table below:
Compilation Error Code Leve Return Code Description
0 0 No diagnostic messages or I-level ( Informational) only.
0 4 W-level (Warning) diagnostic messages (object code generated)
1 8 E-level (Error) diagnostic messages (object code generated but execution behavior is not defined – the source code is in error and should be corrected)
1 12 S-level (Severe) ) diagnostic messages (object code not generated)
1 16 Compiler Abort
The command-line driver mfplx returns 0 upon success and 1 upon failure. If a link is invoked after successful compilation, the mfplx return code is 0 if successful and 1 if failure.
-report []
Specifies the file name for the output of the Open PL/I Source Checker. If this option is not used, the output of the checker will be directed to the standard error file. This option applies to mfplx only.
-setnull
Designates a null pointer value to be returned by the NULL built-in function, where is a decimal value. If this option is not specified, the value of the NULL built-in function is an address with all bits set to 1.
-setstack
Initializes automatic storage to zero.
-so
Generates an object that can be used as a fetchable procedure. Use -so or -dll to build shared fetchable procedure objects based on your operating system.
-shortint
Tells the Compiler to set the default FIXED BINARY precision to
-sql
Invokes the SQL preprocessor for EXEC SQL support. This allows EXEC SQL statements to be recognized and processed to generate native PL/I source code. This option is processed and supported by the EXEC preprocessor (EXEC PP). You can use the following for the -sql option.
odbc
Specifies an ODBC-compliant database.
db2
Specifies an IBM, DB2, or UDB database.
oci
Specifies an oracle "Call" interface database.
-stardesc
Tells the Compiler to produce argument descriptors for calls only when array bounds or string lengths in the parameter declaration are represented by the asterisk (*) symbol. (This was compiler behavior in releases prior to release ) When this option is not used, the Compiler produces descriptors for array, structure, and string arguments.
-stat
Prints Compiler statistics to the standard output as each Compiler phase completes.
-stbout
Generates an .stb file in the same directory as the output object file.

Note: You may need to set the and variables to the appropriate locations when using this option.

-strip (ldpli)
Tells ldpli to not generate debugging information.
-structure_fillers
Tells the Compiler to produce warnings for structures containing fillers.
-systemcics

Specifies that this OPTIONS(MAIN) program will execute under the control of CICS. Such a program may have 0, 1, or 2 parameters, all of which must be POINTER. Such a program, almost always, will specify -cics and may also specify one or more of –sql and –dli.

-systemims
Specifies that this OPTIONS(MAIN) program will execute under the control of IMS. Such a program may have 0 thru n parameters, all of which must be POINTER. Such a program may also specify one or more of –sql and –dli.
-systemmvs
Specifies that this OPTIONS(MAIN) program will execute under the control of MVS. Such a program may have at most one parameter which must be CHAR(n) VARYING where “n” is not *. Such a program may also specify one or more of -cics, –sql and –dli.
-unaligned
This compile-time switch has been added for use on RISC architectures. This switch causes byte instructions to be generated for all based references, which might point anywhere in memory.
-unrefexternals
Causes external entry symbols to be generated in the object file, even if they are not referenced in the program.
-v
Prints information to stdout relating to the compilation and link-step phases. This option applies to mfplx only.
-variant
Passes the variant string to the Open PL/I Macro Preprocessor. This option applies to mfplx only.
-vax
Makes the following adaptations for programs originally written with Digital Equipment Corporations's PL/I Compiler for the VAX platform:
  • Enables Float Binary(24) as equivalent to Float Binary(23).
  • Enables Float Binary(53) as equivalent to Float Binary(52).
  • Causes the BINARY attribute to be assumed if the FIXED attribute is specified without BINARY or DECIMAL.
-warn
Does not suppress INFORMATIONAL and WARNING level diagnostics. This is equivalent to setting the -flag option to . This is the default.
-window
Sets the value for the w window argument used in various date-related built-in functions.
w
Either a positive four-digit integer such as that represents the start of a fixed window or a negative integer that specifies a “sliding” window. For example, -window indicates a window that starts 50 years prior to the year when the program runs.
-xref
Produces cross-reference information in the listing file and specifies the type of cross reference information produced. The cross-reference shows names used in the program with the numbers of the statements where they are either declared of referenced. Only label references on END statements are not included in the listing when using -xref.

Use with -xref to include all identifiers and attributes in the listing. Use with -xref to exclude unreferenced identifiers.

-zalign
Specifies z/OS aggregate mapping and alignment rules.
  • Affects mapping of structure members. z/OS structure mapping rules use a "shift-to-align" algorithm to minimize compiler inserted pad bytes for the alignment requirement of structure members. This differs from the default Open PL/I structure mapping rules described in the Structure topic, which are compatible with other UNIX and Windows compilers for inter-language compatibility.
  • Sets the default FLOAT BINARY single precision to 21 and the default FLOAT BINARY double precision to 53 ( implies -zfloat). The Open PL/I default is 23 and 52 respectively.
  • Specifies that the default alignment attribute for the CHAR, CHAR VAR, GRAPHIC, GRAPHIC VAR, WIDECHAR, WIDECHAR VAR and PICTURE data types is unaligned (implies -zchar). The Open PL/I default is aligned.
  • Implies double-word alignment of double precision FLOAT BINARY on Intel bit systems (the Open PL/I and Intel native default alignment is word on Intel bit systems)
  • Implies double-word alignment of AREA on Intel bit systems (the Open PL/I default alignment is word on Intel bit systems)

Structure Layout Example (Open PL/I default)

The following shows structure ST with size 8 bytes; member "C" is at offset 0 (byte alignment) and member "X" is at offset 4 (word alignment), with 3 compiler-inserted pad bytes between.

1 2 dcl 1 ST, 3 2 C CHAR, 4 2 X FIXED BIN(31); 5 NAME CLASS SIZE LOCATION ATTRIBUTES ST BASED 8 LEVEL 1 STRUCTURE C MEMBER 1 LEVEL 2 CHAR(1) 3 -pad- X MEMBER 4 LEVEL 2 FIXED BIN(31,0)

Structure Layout Example (-zalign)

The following shows structure ST with size 5 (8 bytes are allocated in memory); member "C" is at offset 0 (byte alignment) and member "X" is at offset 1 (word alignment). In this example each member is shifted by 3 bytes (OFFSET=3 as shown below) to properly align each member on its required boundary, thus minimizing (and in this case eliminating) compiler-inserted bytes. Effectively, the "shift-to-align" algorithm propagates pad bytes that fill natural alignment gaps between members toward the beginning of the structure. Pad bytes which have been shifted outside the structure (that is, preceding the first member) are known as "hang bytes".

1 2 dcl 1 ST, 3 2 C CHAR, 4 2 X FIXED BIN(31); 5 NAME CLASS SIZE LOCATION ATTRIBUTES ST BASED 5 LEVEL 1 STRUCTURE OFFSET=3 C MEMBER 1 LEVEL 2 CHAR(1) UNALIGNED X MEMBER 4 LEVEL 2 FIXED BIN(31,0)
Note:
  • The use of this option is recommended only when structure mapping is required to match z/OS structure mapping rules. An example when required might be reading files imported from the mainframe containing record structures that have z/OS compiler-inserted (and possibly removed) pad bytes for alignment purposes.
  • If -zalign is used for the compilation of one module, it is recommended that all modules in a given program be compiled as such for compatibility. Mixing --zalign with compilation units in the same program may work, but this can be problematic if the modules compiled with -zalign are not "self-contained".
  • For adjustable structures (having REFER-extents or non-constant sized members), the -zalign "shift-to-align" algorithm will cause more code to be generated to access structure members with non-constant offsets (seen in the -map listing as (-V-) under the Location Field). Depending upon structure layout, the amount of code generated can be extensive as compared against the Open PL/I default mapping rules (when not using -zalign). Compiler optimization at a minimum level of -opt 2 is recommended.
Restriction:
  • For structures with multiple REFER-extents, compiler resources may be impacted resulting in a Compiler Abort. Please contact Micro Focus SupportLine.
Attention:This feature is in Early Adopter Product (EAP) release status. We intend to provide the finalized feature in a future release. Please contact Micro FocusSupportLineif you require further clarification.

The CICS Web Services feature is EAP for development and testing usage. It should not be used for production deployment in this product release

-zchar
Specifies that the default alignment attribute for the CHAR, CHAR VAR , GRAPHIC, GRAPHIC VAR, WIDECHAR, WIDECHAR VAR and PICTURE data types is unaligned. The Open PL/I default is aligned.

Note: This affects storage requirements for CHAR VAR , GRAPHIC VAR, and WIDECHAR VAR. It also affects parameter and descriptor matching at CALL statements.

Example (Open PL/I default):

Dcl c char; Dcl sub entry (char unaligned); Call sub(c); /* A dummy argument is created for “c” */ Dcl c char; Dcl sub entry (char aligned); Call sub(c); /* “c” is passed by reference */ Example (-zchar) Dcl c char; Dcl sub entry (char unaligned); Call sub(c); /* “c” is passed by reference */ Dcl c char; Dcl sub entry (char aligned); Call sub(c); /* A dummy argument is created for “c” */
-zfloat
Specifies the Float Binary single precision default as 21; specifies the Float Binary double maximum as The Open PL/I defaults are 23 and 52, respectively.

Note: Floating point precisions that are less than or equal to 21 are implemented as IEEE single precision floating point. Floating point precisions that are greater than 21 are implemented as IEEE double precision floating point.

-zp1
Causes all structures to be mapped as if the UNALIGNED attribute is specified at the level 1 structure level. The option is for compatibility with versions of DEC VAX PL/I.

Compiling with -zp1 effectively packs all structures so that any pad bytes used for data alignment are eliminated. This is useful when files originating from the mainframe have records in which the data items are packed or unaligned.

When -zp1 is set, the compiler needs to take certain precautions, especially on RISC architectures where misaligned data can cause a hardware exception.

The -zp1 compiler options affects the following:

  • All structure members are packed without any pad bytes for alignment as if the UNALIGNED attribute were specified at the level 1 structure level.
  • All based variables are treated as if unaligned.
  • All parameters are treated as if unaligned.
  • All Character Varying data items are treated as if unaligned. The Open-PL/I default alignment for CHAR VAR is HALFWORD which is the natural alignment of the leading fixed bin (15) length.

When using -zp1, to maintain consistency in passing arguments without modifying the source code, the compiler disables creating dummy arguments at call points when the argument is a structure member and the argument and parameter descriptors do not explicitly differ between the UNALIGNED and ALIGNED attributes.

Note: Using -zp1 can have an overall impact on performance. On RISC architectures such as SPARC and RS, the compiler must generate sequences of byte addressable instructions to access unaligned data items in the memory. On Intel, no changes are required for code generation, but additional clock cycles are required for the hardware to access misaligned data items.

Important:If you are using this release as an upgrade to Enterprise Developer Update 1, after the upgrade you must rebuild any applications that are compiled using the –zp1option.

The behavior of the –zp1 option has been reverted to that of versions of Enterprise Developer earlier than Update 1, with an additional correction relating to Char Varying data items.

The behavior has been restored to that in Enterprise Developer versions earlier than where, when compiling with –zp1, all parameters are treated as unaligned. (In Enterprise Developer Update 1, the behavior when compiling with –zp1 was to not treat parameters as if unaligned).

When using the –zp1 compiler option, all Character Varying data items are now treated as if unaligned. In previous versions of Open PL/I, for Character Varying data items, the –zp1 unaligned requirement was applied only to structure members and parameters.

To illustrate the change, consider the following example:

zptest: proc options(main); dcl 1 st1, 2 c char, 2 x(4) char(7) var init ('a', 'xx', 'yyy', 'zzzz'); dcl y(4) char(7) var init ('a', 'xx', 'yyy', 'zzzz'); dcl sub entry ((4) char(7) var); call sub (x); call sub (y); end; sub: proc (z); dcl z(4) char(7) var; dcl i fixed bin(31); do i = 1 to hbound(z); z(i) = 'x'; end; end;

Where:

  • For and , each item is 7 plus 2 bytes which equals 9 and then multiplied by 4 equals
  • If were aligned on half-word by default, each array element is half-word aligned and each equals 10 bytes (9 + 1 pad byte), and the total size equals 40 bytes.
  • At , the calling argument and parameter are matched.
  • At the , the element size (10 bytes) is mismatched against the parameter element size (9 bytes) due to –zp1. This is incorrect and causes unexpected program behavior.

Due to this correction of treating all Char Varying data items as if unaligned when using –zp1, the size of CHAR VARYING arrays now differs from previous versions of Open-PL/I. For example:

dcl X(4) char(7) var; Put skip list (size(X)) /* size is 36 bytes vs. 40 bytes in previous versions of Open-PL1 */
Sours: https://www.microfocus.com/documentation/enterprise-developer/ed/Eclipse/BKPUPUUSNGCOMPOP.html

Important COBOL compiler options

Important Cobol Compiler Options SSRANGE, APOST, RENT, OFFSET, LIST

COBOL programs which are coded are called Source module that are not executable. Source code goes thru a process called Compilation that produces object module or Load Module which is an executable code format. These Load modules are stored in a Load Library and are made available to RUN JCL using STEPLIB/JOBLIB during the execution of the JOB.

IGYCRCTL is the IBM provided COBOL Compiler Utility. This will create the Object module which is the input to Link editor-IEWL and it Link edits this object module and creates a Load Module.

Different compiler options can be provided to IGYCRCTL using the PARM. Below are the list of important COBOL Compiler options

SSRANGE and NOSSRANGE

Default&#;>NOSSRANGE
SSRANGE &#; As name implies, its functionality is to check the boundaries. This Compiler Option if used generates an extra code to validate the boundaries of the Subscripts, Indexes, Reference Modifications and makes sure that these are not being addressed outside the size defined. It also takes care of Occurs Depending On values by restricting them not going beyond its limit.

While executing the program this compiler option checks the boundary conditions and throws an abend.
NOSSRANGE is the default one.

Ex: If a Program is trying to access 6th element of a Array which is defined with 5 occurrences only. With SSRANGE compiler option, program abends. With NOSSRANGE, program does not abend but it may fetch garbage.

RENT and NORENT

Default&#;> RENT
These Compiler options tells whether a Program compiled is of RENTrant or Not. RENT makes the program as Re-entrant where as NORENT makes the program as non re-entrant programs.

Re-entrant programs are the ones that does not modify itself when it is reentered after an interruption by the OS.  It is possible because it maintains a separate copy of working storage for each Task. Must use RENT for programs that run under CICS or UNIX. In contrary to a Re-entrant programs, in Pseudo conventional program, a task gets ended without waiting for the user input and after the input is received, it gets started (reentered) from that point only.

LIST

Default&#;>LIST = No
LIST=Yes produces the listing of source code in Assembler language. In case of abends, this listing is very useful in finding the abend location.

OFFSET

Default &#;> NOOFFSET
OFFSET produces the list of relative addresses of Object code which contains Line Number, Location in HEX and Verb.

Sample output:

LINE # HEXLOC VERB LINE # HEXLOC VERB LINE # HEXLOC VERB
A DISPLAY PERFORM A OPEN
DISPLAY E PERFORM CLOSE

LIST and OFFSET are mutually Exclusive.

NUM

Default&#;> NUM=NO
It directs the compiler on which source code line numbers to be used in error conditions. Whether to use line numbers from the generated LISTing or from the Source code.
NUM=No &#;> Uses line number from the compiler generated listing.
=Yes &#;> Uses line numbers from the source code. If there are any copy members in the source code, make sure its line numbers differs from source code line numbers.

SIZE

Default &#;> SIZE(MAX)
It indicates the amount of storage required for compilation.
Syntax: SIZE(MAX) OR SIZE(nnnnn) or SIZE(nnnK)
MAX&#;> allocates MAX possible main storage for the compile process
If the compilation is in bit then it allocates all the storage above 16MB line in Used region.

nnnnn&#;> is a decimal number which should be greater than or equal to
nnnK &#;> is also a decimal representation but in increments of 1-KB. Minimum value is K

TEST

Default &#;> NOTEST
It enables the debugging facility. With TEST compiler options the programs can be debugged also it has few sub options which enables the JUMPTO and GOTO debugger options.

QUOTE|APOST

Default &#;> QUOTE
This compiler options indicates whether to use Double Quotation marks(&#;) or Single Quotation Marks(&#;) as a delimiter for non numeric literals.
Quote&#;> Directs to use Double quotes as the delimiter
APOST&#;> Directs to use Single quotes as the delimiter

LANGUAGE

Default&#;> LANGUAGE=EN

This is to indicate what language to be used for the Output Compiler listing messages.
EN&#;> Mixed case US English
JP&#;> Japanese
UE&#;> Upper case US English

SQL

Default&#;> SQL=No
Used for COBOL-DB2 programs so that the DB2 co processor gets enabled.
SQL=YES &#;> use YES if there are any SQL statements in the program.

About Author

admin
Sours: http://www.techtricky.com/important-cobol-compiler-options/
  1. Anthony ink master
  2. 2016 honda civic vin number
  3. Twitch desktop version
  4. Uhaul mission gorge

VS COBOL II Support

CALL identifier, dynamic (less storage, more CPU)

To call a program dynamically you must use the call identifier format.

A VS COBOL II program can use the COBOL CALL verb to invoke an assembler or COBOL II subprogram. The CA IDMS TRANSFER CONTROL (LINK or XCTL) must be used for invoking VS COBOL subprograms. The subprogram must be defined to the system either at SYSGEN or by using a DCMT VARY DYNAMIC PROGRAM command. The correct language must be specified, and the NONOVERLAYABLE attribute must also be specified.

A COBOL II program and all the COBOL II subprograms that it calls dynamically must be compiled with the same RES/NORES compiler option.

A dynamic call is often a more efficient way for one online VS COBOL II program to call another than the use of a TRANSFER CONTROL DML command. Note, however, that when a dynamic call is made, the DC/UCF system is not aware that the application is running in a new program. Therefore, error messages and program statistics will not reflect the call.

There are also restrictions on using static or dynamic calls when invoking an assembler subprogram. If the assembler program is not fully reentrant or if the assembler program issues any operating system SVC instructions, the program must be invoked with a DC TRANSFER control statement. Note that use of SVC instructions in an online program presents security and performance concerns. Such instructions should be avoided unless they are absolutely necessary. In most cases, DC/UCF system functions can be used instead.

Note: Also see "Performance Improvements with RHDCLEFE" in Appendix I:.

Sours: https://ftpdocs.broadcom.com/cadocs/0/CA%20IDMS%%%20User%20Bookshelf-ENU/Bookshelf_Files/HTML/IDMS_DML_COBOL_Ref_ENU/html
Free COBOL Compiler - How to execute a COBOL Program

F1 for Mainframe

ADV

Default

ADV=YES

YES

Adds one byte to the record length for the printer control character. This option might be useful to programmers who use WRITE. . .ADVANCING in their source files. The first character of the record does not have to be explicitly reserved by the programmer.

NO

Does not adjust the record length for WRITE. . .ADVANCING. The compiler uses the first character of the specified record area to place the printer control character. The application programmer must ensure that the record description allows for this additional byte.

Notes:

1. With ADV=YES, the record length on the physical device is one byte larger than the record description length in the source program.

2. If the record length for the output file is not defined in the source code, COBOL ensures that the DCB parameters are appropriately set.

3. If ADV=YES is specified, and the record length for the output file has been defined in the source code, the programmer must specify the record description length as one byte larger than the source program record description. The programmer must also specify the block size in correct multiples of the larger record size.

4. If the LINAGE clause is specified in a file description (FD), the compiler treats that file as if ADV=YES has been specified.

ARITH

Default

ARITH=COMPAT

COMPAT

Specifies 18 digits as the maximum precision for decimal data.

EXTEND

Specifies 31 digits as the maximum precision for decimal data.

CICS

Default

CICS=NO

NO

When the NO option is specified, any CICS statements that are found in the source program are diagnosed and discarded.

YES

If a COBOL source program contains CICS statements and has not been preprocessed by the CICS translator, the YES option must be specified.

Notes:

The CICS compiler option can contain CICS suboptions. The CICS suboptions delimiter can be quotes or apostrophes. CICS suboptions cannot be specified as a COBOL installation default.

You can specify the CICS compiler option in any of the compiler option sources: installation defaults, compiler invocation, or PROCESS or CBL statements.

COMPILE

 Default

COMPILE=NOC(S)

YES

Indicates that you want full compilation, including diagnostics and object code.

NOC

Indicates that you want only a syntax check.

NOC(W)

NOC(E)

NOC(S)

Specifies an error message level: W is warning; E is error; S is severe. When an error of the level specified or of a more severe level occurs, compilation stops, and only syntax checking is done for the balance of the compilation.

Note: Specifying NOCOMPILE might affect the Associated Data file by stopping compilation prematurely, resulting in loss of specific messages.

DECK

 Default

DECK=NO

YES

Places the generated object code in a file defined by SYSPUNCH.

NO

Sends no object code to SYSPUNCH.

DIAGTRUNC

Default

DIAGTRUNC=NO

YES

Causes the compiler to issue a severity-4 (warning) diagnostic message for MOVE statements with numeric receivers when the receiving data item has fewer integer positions than the sending data item or literal.

NO

Does not cause the compiler to produce a severity-4 message.

Notes:

The diagnostic is also issued for moves to numeric receivers from alphanumeric data names or literal senders, except when the sending field is reference modified. There is no diagnostic for COMP-5 receivers, nor for binary receivers when you specify the TRUNC(BIN) option.

DYNAM

Default

DYNAM=NO

YES

Dynamically loads subprograms that are invoked through the CALL literal statement.

Performance consideration: Using DYNAM=YES eases subprogram maintenance because the application is not relink-edited if the subprogram is changed. However, individual applications with CALL literal statements can experience some performance degradation due to a longer path length.

NO

Includes, in the calling program, the text files of subprograms called with a CALL literal statement into a single module file.

Notes:

The DYNAM option has no effect on the CALL identifier statement at compile time. The CALL identifier statement always compiles to a dynamic call.

Do not specify DYNAM=YES for applications running under CICS.

FLAG

Default

FLAG=(I,I)

Note: The second severity level used in this syntax must be equal to or higher than the first.

x

I|W|E|S|U

Specifies that errors at or above the severity level specified are flagged and written at the end of the source listing.

ID Type Return Code

I Information 0

W Warning 4

E Error 8

S Severe error 12

U Unrecoverable error 16

y

I|W|E|S|U

The optional second severity level specifies the level of syntax messages embedded in the source listing in addition to being at the end of the listing.

NO

Indicates that no error messages are flagged.

Notes:

If the messages are to be embedded, SOURCE must be specified at compile time. Embedded messages enhance productivity because they are placed after the referenced source statement.

Specification of FLAG(W|E|S) might result in the loss of entire classes of messages from the Events records in the Associated Date file. See Enterprise COBOL for z/OS Programming Guide for more information.

LIB

Default

LIB=NO

YES

Indicates that the source program contains COPY or BASIS statements.

NO

Indicates that the source program doesn&#;t contain COPY or BASIS statements.

LIST

Default

LIST=NO

YES

Produces a listing that includes:

The assembler-language expansion of source code

Information about working storage

Global tables

Literal pools

NO

Suppresses this listing.

Note: The LIST and OFFSET compiler options are mutually exclusive. Setting OFFSET=YES and LIST=YES results in a nonzero return code and an error message during assembly of the customization macro.

NUM

Default

NUM=NO

YES

Uses the line numbers from the source program rather than compiler-generated line numbers for error messages and procedure maps.

NO

Uses the compiler-generated line numbers for error messages and procedure maps.

Notes:

If COBOL programmers use COPY statements and NUM=YES is in effect, they must ensure that the source program line numbers and the COPY member line numbers are coordinated.

SOURCE

Default

SOURCE=YES

YES

Indicates that you want a listing of the source statements in the compiler-generated output. This listing also includes any statements embedded by COPY.

NO

Source statements do not appear in the output.

Note: The SOURCE compiler option must be in effect at compile time if you want embedded messages in the source listing.

SQL

Default

SQL=NO

NO

Specify to have any SQL statements found in the source program diagnosed and discarded.

Use SQL=NO if your COBOL source programs do not contain SQL statements, or if the separate SQL preprocessor will be used to process SQL statements before invocation of the COBOL compiler.

YES

Use to enable the DB2 coprocessor capability and to specify DB2 suboptions. You must specify the SQL option if your COBOL source program contains SQL statements and it has not been processed by the DB2 precompiler.

Notes:

1. You can specify the SQL option in any of the compiler option sources: compiler invocation, PROCESS/CBL statements, or installation defaults.

2. Use either quotes or apostrophes to delimit the string of DB2 suboptions.

3. DB2 suboptions cannot be specified as part of customizing the SQL option. (DB2 suboptions are supported only when the SQL compiler option is specified as an invocation option or on a CBLor PROCESS card.) However, default DB2 options can be specified when you customize the DB2 product installation defaults.

4. The SQL=YES option conflicts with the LIB=NO option.

SSRANGE

Default

SSRANGE=NO

YES

Generates code that checks subscripts, reference modifications, variable-length group ranges, and indexes in the source program at run time to ensure that they do not refer to storage outside the area assigned. It also verifies that a table with ALL subscripting, specified as a function argument, contains at least one occurrence in the table.

The generated code also checks that a variable-length item does not exceed its defined maximum length as a result of incorrect setting of the OCCURS DEPENDING ON object.

Performance consideration: If SSRANGE=YES at compile time, object code size is increased and there will be an increase in runtime overhead to accomplish the range checking.

NO

No code is generated to perform subscript or index checking at run time.

Notes:

If the SSRANGE option is in effect at compile time, the range-checking code is generated.

Range-checking can be inhibited at run time by specifying the Language Environment runtime option CHECK(OFF). However, the range-checking code still requires overhead and is dormant within the object code.

The range-checking code can be used optionally to aid in resolving any unexpected errors without recompilation.

VBREF

Default

VBREF=NO

YES

Produces a cross-reference of all verb types in a source program to the line numbers where they are found. VBREF=YES also produces a summary of how many times each verb was used in the program.

NO

Does not produce a cross-reference or verb-summary listing.

For More Options, Look into

http://publib.boulder.ibm.com/infocenter/pdthelp/v1r1/index.jsp?topic=/com.ibm.entcobol.doc_/igyc1plc.htm

If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog

You may also like to look at:

Like this:

LikeLoading

Related

Sours: https://mainframesf1.com//04/05/cobol-compiler-options/

Options cobol compile


Compiling COBOL and PL/I Programs and Assembling Maps

You can use the Development System Compilation Menu to compile COBOL and PL/I programs and to assemble BMS maps.

This chapter contains the following topics:

Compilation Menu Functions

On the Development System Compilation Menu, you can select files to edit or compile or set Copylib directories. FIGURE shows the functions available from the Compilation Menu.

 

Diagram showing the actions performed when you make a selection on the Compilation Menu.

Displaying the Compilation Menu

The Compilation menu shown in FIGURE is similar to the standard file selection screen in Sun MTP.


procedure icon  To Display the Compilation Menu

single-step bulletPress PF4 on the Development System main menu.

 

Screen shot showing the Compilation Menu.

The two display criteria fields at the top of the screen are:

Directory

Complete path name of the directory containing the programs to be compiled. The first element can be an environment variable.

Extensions

Specify up to eight file extensions. The extensions indicate the file type:

: Adheres to IBM OS/VS COBOL compiler standards; assumed to be CICS programs.

: Adheres to IBM COBOL2 compiler standards; assumed to be CICS programs.

: Batch programs.

: BMS maps. This file is assembled.

: Adheres to Liant Open PL/I standards.

: Adheres to Liant Open PL/I standards.

: Adheres to Liant Open PL/I standards; assumed to contain statements.

: Adheres to Liant Open PL/I standards; assumed to be database programs.


Descriptions of the file information fields are located in TABLE


procedure icon  To Select Files

1. Move the cursor to the selection field to the left of the file name and type an uppercase or lowercase beside the file name.

2. Press the function key for the action you want to perform.

The following table describes the function keys on the Compilation Menu.

Function Key

Action

PF2

Executes the shell script, which opens the selected file, by default, in the editor. If you select multiple files, the last file selected is edited first and the first file selected is edited last. The script is invoked automatically for each file.

PF3

Closes the Compilation Menu and returns to the Development System main menu.

PF4

Refreshes the data in the file list portion of the screen. After you modify a file's attributes, press PF4 to update the screen.

PF5

Displays the Copylib Settings screen. See COBOL Copylib Settings.

PF6

Displays an options screen, depending on the file selected:

, or files: Displays the Set Compiler Options screen for COBOL. See Compiling COBOL Programs.

, , or files: Displays the Set Compiler Options screen for PL/I. See Compiling Online PL/I Programs.

files: Displays the Set Assembler Options Screen. See Assembling BMS Maps.

PF7

Displays the previous page of files. If the top of the file list is displayed, this message is displayed:

Beginning of data reached

PF8

Displays the next page of files. If the bottom of the file list is displayed, this message is displayed:

End of data reached

PF9

Redisplays the contents of the directory, sorted by file name.

PF10

Redisplays the contents of the directory, sorted in descending sequence by the file modification date.

PF11

Redisplays the contents of the directory, sorted in descending sequence by the file size.

Enter

No action takes place unless a file is selected. If a file is selected, either the Compiler or the Assembler screen is displayed, depending on the file extension.

If a directory is selected, the directory changes to the selected directory and the files in that directory are displayed.


COBOL Copylib Settings

The Copylib Settings screen enables you to set a maximum of eight directories that are searched for copybooks referenced in the COBOL source code. Directories are searched in the following order:

1. Current directory

2. Directories defined on the Copylib Settings screen

3. Directories defined by the environment variable

Refer to the COBOL documentation for information about the environment variable.


procedure icon  To Display the Copylib Settings Screen

single-step bulletPress PF5 on the Compilation menu.

The screen (FIGURE ) contains eight fields to enter directories that contain the copybooks. The first element in the directory name can be an environment variable, designated with a dollar sign ($). The environment variable can be followed by other subdirectories separated by slashes (/).

 

Screen shot showing the Copylib Settings screen.[ D ]

The Copylib settings, as well as other user-specific options, are maintained in the file /user-name, where user-name is the user's login name. The options are saved from session to session.

Compiling COBOL Programs

You can set COBOL compiler options and compile your programs either from the Compilation Menu or from the command line.

To compile batch programs using the command line interface, see Chapter

Using the Compilation Menu

The Set Compiler Options screen for COBOL enables you to customize the actions of the compiler.


procedure icon  To Display the Set Compiler Options Screen

1. Select a COBOL program file on the Compilation menu (FIGURE ).

2. Press PF6 to display the Set Compiler Options screen.

 

Screen shot of the Set Compiler Options Screen after selecting a COBOL program.[ D ]

COBOL Compiler Options

Modify the screen values if you need to.

Output filename

Name of the currently selected file displays as the default. You can change the file name. A file name can be up to 14 characters.

Output environment

Defaults to the directory name on the Compilation menu screen. You can change this value. The first element in this field can be an environment variable, which can be followed by other subdirectories separated by slashes.


Some compiler options and directives are set automatically based on the extension of the selected file. You set others by modifying the default values on the screen.

The following options and directives for online programs are set based on the file extension:

:

:

The following options and directives for batch programs are set based on the file extension:

:

where:

Sets the verbose option, which displays information about the compile.

Allocates data in sizes that are compatible with the mainframe.

The compiler treats statements similar to those used by mainframes.

Controls how storage is initialized. This storage is declared in a COBOL program and does not have a value statement associated with it. For online programs, this directive is set to zero to ensure that storage is set to low values. For batch programs, this option is set to 32 to ensure that storage is set to spaces.

For OS/VS COBOL programs, allows the use of BLL cells.




Note - Do not try to compile translated online programs with extensions.



The options and directives on the Set Compiler Options screen for COBOL are listed in the following table with the corresponding COBOL directive. Refer to your COBOL documentation for more information about using COBOL directives.

Screen Option

COBOL Directive/Option

Listing

Bounds

Alter

Animator

Output

(intermediate code) / (native code)

Xref

Optimize

ANSI 85

Err List

Trunc

VS COBOL2


The options and directives you set on the Set Compiler Options screen, as well as other user-specific directives, are saved in a file called user-name, where user-name is the user's login name. These directives are saved from session to session.

You can set other directives in the file. You can also change the default COBOL directives by modifying the shell script.


procedure icon  To Compile the Program

single-step bulletPress PF4 on the Set Compiler Options screen to execute the shell script, which calls the COBOL compiler.

If or programs are selected, they are translated and compiled. If programs are selected, they are compiled, but not translated. If multiple files were selected, the files are compiled in reverse order; the last file selected is compiled first.

When compiling is complete, the editor displays the results of the compile and translation in the default editor ().

Using the Command-Line Interface

Before you can compile an online program using the command-line interface, you must process it using the translator. After the program is translated successfully, you can compile it. When compiling programs, you usually use a set of directives on a regular basis. These directives vary according to the type of COBOL (OS/VS, COBOL2) programs being compiled. Some of these directives are required by Sun MTP to ensure that the programs compile properly. Refer to your COBOL documentation for a description of the compiler options and directives.

Translating Programs

is the Sun MTP Common Language Translator. It locates and includes all copy files before translating CICS COBOL statements to COBOL statements. Therefore, you must set the environment variable before running . points to the location of your COBOL copybooks, mapset copybooks (if any), and to the Sun MTP copybook directory. For example:

export COBCPY=path-name/copy:path-name/maps:$UNIKIX/copy

To translate an OS/VS COBOL program named and produce an output file named , type the following command:

If errors occur during translation, you must correct the program and translate it again.

Refer to the Sun Mainframe Transaction Processing Software Reference Guide for a description of and its options.

Compiler Directives

Use the following directives to compile online COBOL2 programs. Refer to the COBOL documentation for other compiler options you might require.

Use the following directives to compile online OS/VS COBOL programs. Refer to the COBOL documentation for other compiler options you might require.

Using Scripts and Makefiles to Compile

You can type directives on the command line or you can specify the name of a file containing a list of directives.

Example: The following command to compile a COBOL2 program contains all its directives and four options () on the command line.

$

Example: The following command to compile an OS/VS COBOL program contains its directives in a file named , and four options () on the command line.

$ path-name

You can also create shell scripts to compile a single program or all the programs in one directory.

The following example illustrates a script for compiling one program. The environment variable must be set to the appropriate directives file.

for source do echo $source cob -iaPV $source if [ $? -ne 0 ] then echo "Error in compilation of: " $source exit fi done

CODE EXAMPLE illustrates a script that translates and compiles all online programs in a directory. The script also captures log files indicating an error or successful completion. Programs are compiled only after successful translation.

for i in `ls *.cl2` do echo about to kixclt `basename $i .cl2`.cl2 echo about to kixclt `basename $i .cl2`.cl2 >> COMPALL.err echo about to kixclt `basename $i .cl2`.cl2 >> COMPALL.log kixclt options `basename $i .cl2`.cl2 ReturnCode=$? if [ $ReturnCode -ne 0 ] then echo "Error detected during kixclt of `basename $i .cl2`" >> COMPALL.err else echo about to compile `basename $i .cl2`.cbl echo about to compile `basename $i .cl2`.cbl >> COMPALL.err cob options and directives `basename $i .cl2`.cbl ReturnCode=$? if [ $ReturnCode -ne 0 ] then echo "Error detected during cob of `basename $i .cbl`" >> COMPALL.err else echo "Compile completed for `basename $i .cl2`" >> COMPALL.err rm `basename $i .cl2`.cbl fi fi done

The directory contains a shell script , which builds the sample accounting application. You can use it as a model to build your own scripts.

As an alternative to using script files, you can use a to compile COBOL programs. The advantage of using a is that it can selectively compile only those programs whose source has changed.



Note - Before using a , you must understand the concepts of the function.



The following code example illustrates a that translates and compiles COBOL programs whose source code has changed since the last time the was executed.

# *********************************************** # CICS Application Programming Primer # Enter into Catalog: # dataset reclen keylen type # ACCTFIL 5 KSDS # ACCTIX 63 17 KSDS # ***********************************************   # *********************************************** # rules # ***********************************************   .SUFFIXES: .clt .cbl .int .gnt .bms .map   .clt.cbl: rm -f $*.cbl ( kixclt $*.clt )   .cbl.int: rm -f $*.int $*.idy cob -ia $(COBFLAGS) $<   .cbl.gnt: rm -f $*.gnt cob -u $(COBFLAGS) $<   .bms.map: rm -f $*.map $*.err $*.lst kixbms -a $<   # *********************************************** # variables to rules # ***********************************************   # Cobflags for CLT modules COBFLAGS=-C "ibmcomp cics noalter osvs defaultbyte=0"   # Cobflags for CL2 modules COBFLAGS1=-C "ibmcomp noalter osvs defaultbyte=0"   # *********************************************** # standard variables # ***********************************************   # *********************************************** # standard targets # ***********************************************   all: $(INTTARGETS)   INTTARGETS: ACCTint ACCTint ACCTint ACCTint \ ACCTint   GNTTARGETS: ACCTgnt ACCTgnt ACCTgnt ACCTgnt \ ACCTgnt   clean: rm -f *.gnt rm -f *.int rm -f *.idy   # *********************************************** # Targets with dependencies # *********************************************** ACCTint: ACCTclt ACCTcbl   ACCTint: ACCTclt ACCTcbl   ACCTint: ACCTclt ACCTcbl   ACCTint: ACCTclt ACCTcbl   ACCTint: ACCTclt ACCTcbl   ACCTgnt: ACCTclt ACCTcbl   ACCTgnt: ACCTclt ACCTcbl   ACCTgnt: ACCTclt ACCTcbl   ACCTgnt: ACCTclt ACCTcbl   ACCTgnt: ACCTclt ACCTcbl

Compiling COBOL Programs to for Production Systems

You must compile your COBOL programs for execution in mode for a production system. The files are native code and execute faster than code.

In a test environment, if you want to use Micro Focus Animator, refer to the Micro Focus documentation for the appropriate options.

Compiling Online PL/I Programs

The Set Compiler Options screen for PL/I shown in FIGURE enables you to customize the actions of the Open PL/I compiler.


procedure icon  To Display the Set PL/I Compiler Options Screen

1. Select a PL/I program file on the Compilation menu (FIGURE ).

2. Press PF6.

 

Screen shot showing the Set Compiler Options Screen after selecting a PL/I program.[ D ]

Output filename

Name of the currently selected file displays as the default. You can change the file name; up to 14 characters.

Output environment

Defaults to the directory name entered on the Compilation menu. The environment can be any directory. You can use an environment variable as the first element in the output environment field, followed by other subdirectories separated by slashes.


PL/I Compiler Options

The following compiler options are set automatically based on the extension of the selected file.

Open PL/I commands only.

Open PL/I with commands.

Open PL/I with commands and database (Oracle) commands.




Note - Do not mix Liant Open PL/I filename extensions with COBOL filename extensions in a single set of selections. If you do, the error message is displayed.



Other options are set by modifying the default values on the screen. The options on the Set Compiler Options screen for PL/I are listed in the following table with the corresponding Liant Open PL/I options. Refer to the Open PL/I User's Guide for more information.

Screen Option

Open PL/I Option

nodebuginfo

Used for debugging with CodeWatch

Expnded List

Produces expanded listing

Alloc Map

Produces storage allocation map in listing

PIC

Position-Independent-Code

Unaligned

Unaligned PL/I structures at level 1

Optimize 2

Level of optimization

Debug (CW)

Specifies to use CodeWatch

CICS dbg CW

Allows CodeWatch to debug precompiler-generated code


These options plus other user-specific options are maintained in a file called user-name, where user-name is the user's login name. The options are saved from session to session.


procedure icon  To Compile the Program

single-step bulletPress PF4 on the Set Compiler Options screen.

This executes the shell script, which calls the Liant Open PL/I compiler, the Oracle pre-compiler ( extension), or the preprocessing translator, depending on the filename extension of the source file. If multiple files are selected, the files are compiled in reverse order; the last file selected is compiled first.

When the compilation completes, the results of the compile and translation are displayed in the default editor ().

Assembling BMS Maps

You can set BMS Assembler options and assemble your BMS maps either from the Compilation Menu or from the command line.

Using the Compilation Menu

The Set Assembler Options screen enables you to customize the BMS assembler's actions.


procedure icon  To Display the Set Assembler Options Screen

1. Select a file with a extension on the Compilation menu (FIGURE ).

2. Press PF6.

 

Screen shot showing the Set Assembler Options Screen after selecting a .bms file.[ D ]

Edit the following values on the screen:

Output filename

Name of the currently selected file displays by default. You can change the filename; up to 14 characters.

Output Environment

Defaults to the directory name on the Compilation menu. The environment can be any directory in which any element can be an environment variable designated with a leading dollar sign. The environment variable can be preceded or followed by other subdirectories delimited with slashes.

Generate Language copy member

Create a COBOL copybook, PL/I include file, or C header file. The type of copy member created depends on the value of in the file.

: Create the copy member

: Do not create the copy member

Generate List file output

Create a list file showing the results of the assembly.

: Creates a temporary file in the editor and displays it on your screen.

  • To save the file, type filename
  • The file is saved to the directory specified in Output Environment, unless you specify a different directory when saving the file.

: Do not create a listing file.



procedure icon  To Assemble the Map

single-step bulletPress PF4 on the Set Assembler Options screen.

This executes the shell script, which calls the BMS assembler, . If multiple files are selected, the files are assembled in reverse order; the last file selected is assembled first.

After each file is assembled, the default editor () displays the results of the assembly.

Using the Command Line-Interface to Assemble Maps

Use the command to assemble BMS maps. You can specify one or more files with extensions to assemble; creates map files with extensions.

Example: Type the following command at the command prompt to assemble a BMS map named and produce a copy member for inclusion in the programs. The output is a file named .

See Chapter 9 for more information about managing maps and refer to the Sun Mainframe Transaction Processing Software Reference Guide for a description of all the options.

Copyright &#; , Sun Microsystems, Inc. All rights reserved.

Sours: https://docs.oracle.com/cd/E/serversk//develcobcomp.html
IBM MVS - Editing, compiling and executing a Cobol program - M2

.

Now discussing:

.



585 586 587 588 589