#pragma margins/nomargins

Purpose

Specifies the columns in the input line to scan for input to the compiler.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-#--pragma--+-margins--(--first_column--,--last_column--)-+--><
              '-nomargins-----------------------------------'   

Defaults

  • C only. margins(1,72) for fixed-length records. nomargins for variable-length records. C only.
  • C++ only. nomargins for all records. C++ only.

Parameters

margins
Specifies that only text within a range of margins, specified by first_column and last_column, is to be scanned by the compiler. The compiler ignores any text in the source input that does not fall within the range.

C++ only. Specifying margins with no parameters is equivalent to margins(1,72) for both fixed or variable length records. C++ only.

nomargins
Specifies that all input is to be scanned by the compiler.
first_column
A number representing the first column of the source input to be scanned. The value of first_column must be greater than 0, less than 32761, and less than or equal to the value of last_column.
last_column
A number representing the last column of the source input to be scanned. The value of last_column must be greater than the value of first_column, and less than 32761.

You can also use an asterisk (*) to indicate the last column of the input record. For example, if you specify #pragma margins (8, *), the compiler scans from column 8 to the end of input record.

Usage

The pragmas override the MARGINS or NOMARGINS compiler options. The setting specified by the #pragma margins directive applies only to the source file or include file in which it is found. It has no effect on other include files.

You can use #pragma margins and #pragma sequence together. If they reserve the same columns, #pragma sequence has priority and it reserves the columns for sequence numbers. For example, assume columns 1 to 20 are reserved for the margin, and columns 15 to 25 are reserved for sequence numbers. In this case, the margin will be from column 1 to 14, and the columns reserved for sequence numbers will be from 15 to 25.

Related information

  • #pragma sequence
  • The MARGINS compiler option in the z/OS® XL C/C++ User's Guide.