MARGINS | NOMARGINS

Category

Compiler input

Pragma equivalent

#pragma margins, #pragma nomargins

Purpose

Specifies, inclusively, the range of source column numbers that will be compiled.

When the MARGINS option is in effect, you can specify the columns in the input record that are to be scanned for input to the compiler. The compiler ignores text in the source input that does not fall within the range that is specified in the MARGINS option.

When the NOMARGINS options is in effect, the entire input source record will be scanned for input to the compiler.

Syntax

For C++:

Read syntax diagramSkip visual syntax diagram
   .-NOMAR----------.   
>>-+-MAR--+-------+-+------------------------------------------><
          '-(m,n)-'     

For C:

Read syntax diagramSkip visual syntax diagram
   .-MAR--(m,n)-.   
>>-+-NOMAR------+----------------------------------------------><

Defaults

Parameters

m
Specifies the first column of the source input that contains valid z/OS XL C/C++ code. The value of m must be greater than 0 and less than 32761.
n
Specifies the last column of the source input that contains valid z/OS XL C/C++ code. The value of n must be greater than m and less than 32761. An asterisk (*) can be assigned to n to indicate the last column of the input record. If you specify MARGINS(9,*), the compiler scans from column 9 to the end of the record for input source statements.

Usage

For C++, when the MARGINS option is specified without suboptions, the default values for the first and last column of the source input are 1 and 32760 respectively. Prior to z/OS V2R1, the values were 1 and 72. Note that specifying the MARGINS option without suboptions is valid for C++ only.

You can use the MARGINS and SEQUENCE compiler options together. The MARGINS option is applied first to determine which columns are to be scanned. The SEQUENCE option is then applied to determine which of these columns are not to be scanned. If the SEQUENCE settings do not fall within the MARGINS settings, the SEQUENCE option has no effect.

When a source (or include) file is opened, it initially gets the margins and sequence specified on the command line (or the defaults if none was specified). You can reset these settings by using #pragma margins or #pragma sequence at any point in the file. When an #include file returns, the previous file keeps the settings it had when it encountered the #include directive.

If the MARGINS option is specified along with the SOURCE option in a C or C++ program, only the range specified on the MARGINS option is shown in the compiler source listing.

Notes:
  1. The MARGINS option does not reformat listings.
  2. If your program uses the #include preprocessor directive to include z/OS XL C library header files and you want to use the MARGINS option, you must ensure that the specifications on the MARGINS option does not exclude columns 20 through 50. That is, the value of m must be less than 20, and the value of n must be greater than 50. If your program does not include any z/OS XL C library header files, you can specify any setting you want on the MARGINS option when the setting is consistent with your own include files.

Predefined macros

None.

Related information

For more information on related compiler options, see