AD - Attribute Definition

#### Search Results

Search

# AD - Attribute Definition

With this session parameter, you specify field attributes at field/element or statement level.

Related session parameter: `CD` - Color Definition

Possible settings | See AD Parameter Syntax. | You can specify multiple attributes in any sequence.
Default setting | See below. |
Applicable statements | `FORMAT` |
`DISPLAY` `INPUT` `NEWPAGE WITH TITLE` `PRINT` `REINPUT` `WRITE` `WRITE TITLE` `WRITE TRAILER` | Parameter may be specified at statement level and/or at element level.
`ASSIGN` `CALLNAT` `CALLDBPROC` `COMPUTE` `MOVE` `PERFORM` `SEND METHOD` | Parameter may be specified at element level, however, only the attributes specified in the relevant statement description can be used.
Applicable command | none

The following topics are covered below:

- AD Parameter Syntax

- Field Representation

- Field Alignment

- Field Input/Output Characteristics

- Interpretation of Alphanumeric Fields

- Mandatory Input

- Length of Input Value

- Field Upper/Lower Case Characteristics

- Filler Character

## AD Parameter Syntax

AD=[field-representation] [field-alignment] [field-i/o-characteristics] [interpretation-of-alphanumeric-fields] [mandatory-input] [input-value-length] [field-upper/lower-case] [filler-character]

You can specify multiple attributes in any sequence. Possible values are:

`AD=` |  | `B C D I N U V Y` |  |  |  | `L R Z` |  |  |  | `A` `M` `O` `P` |  |  |  | `Q` |  |  |  | `E F` |  |  |  | `G H` |  |  |  | `T W` |  |  |  | '`c`' |

The meaning of the attributes and the possible values are explained below.

#### Examples:

    DISPLAY #FIELDA (AD=R)
    INPUT #FIELDB (AD=M)
    INPUT (AD=IM) #FIELDA #FIELDB

## Field Representation

Value | Meaning | Statements | Explanation
--- | --- | --- | ---
`B` | blinking (*) | `ASSIGN` `COMPUTE` `MOVE` `DISPLAY` `FORMAT` `INPUT` `PRINT` `REINPUT` `WRITE` | The value of the field is displayed blinking.
`C` | cursive/italic (*) | The value of the field is displayed cursive/italic.
`D` | default intensity | The value of the field is displayed with normal intensity, that is, not highlighted in any way. This is the default value.
`I` | intensified | The value of the field is displayed intensified.
`N` | non-display | A value entered in the field will not be displayed.
`U` | underlined | The value of the field is displayed underlined.
`V` | reverse video (*) | The value of the field is displayed reverse video.
`Y` | dynamic attributes | `INPUT` `DISPLAY` `PRINT` `WRITE` | Attributes are to be controlled via an attribute control variable (Format C).

* The field representation attributes marked with an asterisk (*) require corresponding hardware features, and will be ignored at runtime if these features are not available.

## Field Alignment

Value | Meaning | Statements | Explanation
--- | --- | --- | ---
`L` | left-justified | `DISPLAY` `FORMAT` `INPUT` `PRINT` `REINPUT` `WRITE` | The value of the field is displayed left-justified. This is the default value for alphanumeric fields.
`R` | right-justified | The value of the field is displayed right-justified. This is the default value for numeric fields.
`Z` | leading zeros | Numeric values are displayed with leading zeros, right-justified.

## Field Input/Output Characteristics

Value | Meaning | Statements | Explanation
--- | --- | --- | ---
`A` | input field, non-protected | `INPUT` `FORMAT` | The value of the field is to be entered in response to the `INPUT` statement. This is the default value.
input only | `CALLNAT` `CALLDBPROC` `PERFORM` `SEND METHOD` Function Call | If you mark a parameter with `AD=A`, its value will not be passed to the called object (subprogram, stored procedure, subroutine, dialog, method), but it will receive a value from the called object. For a field defined with `BY VALUE` in the called object's parameter data area, the calling object cannot receive a value. In this case, `AD=A` only causes the field to be reset to the low value of the respective format (blanks for alphanumeric, binary zeroes for binary and zeroes for numeric fields) before the object is called. For `CALLNAT`, `AD=A` may be useful for remote subprograms executed via Natural RPC in a client/server environment to reduce the load of data sent. If a subprogram is executed locally, `AD=A` fields will be reset to the low value of the respective format before the object is called. If for `SEND METHOD`, a method is not implemented in Natural, the behavior depends on the method implementation. The parameter is then passed as an initialized variant. Whether the external component is able to return a value is described in the documentation of the external component. It can also be viewed in the Natural Component Browser.
`M` | output field, modifiable | `INPUT` `FORMAT` | The value of the field is to be displayed during `INPUT` statement execution, and a different value may be entered by the user. The field is an output field and may be modified.
modifiable | `CALLNAT` `CALLDBPROC` `PERFORM` `SEND METHOD` Function Call | By default, the passed value of a parameter can be changed in the called object (subprogram, stored procedure, subroutine, dialog, method) and the changed value passed back to the calling object, where it overwrites the original value. For a field defined with `BY VALUE` in the called object's parameter data area, no value is passed back. If, for `SEND METHOD`, a method is not implemented in Natural, the behavior depends on the method implementation. The parameter is then passed `BY REFERENCE`. Whether the external component accepts a by reference or by value parameter is described in the documentation of the external component. It can also be viewed in the Natural Component Browser.
`O` | output field, write-protected | `INPUT` `FORMAT` | The value of the field is to be displayed during `INPUT` execution. The field is an output field and may not be modified.
non-modifiable | `CALLNAT` `CALLDBPROC` `PERFORM` `SEND METHOD` Function Call | If you mark a parameter with `AD=O`, the passed value can be changed in the called object (subprogram, stored procedure, subroutine, dialog, method), but the changed value cannot be passed back to the calling object; that is, the field in the calling object retains its original value. Internally, `AD=O` is processed in the same way as a call-by-value (see `BY VALUE` in the section Parameter Data Definition in the description of the `DEFINE DATA` statement). If for `SEND METHOD`, a method is implemented in Natural, the parameter is treated like it was defined `BY VALUE` in the method's parameter data area (see the PARAMETER clause of the `INTERFACE` statement). If for `SEND METHOD`, a method is not implemented in Natural, the behavior depends on the method implementation. The parameter is then passed `BY VALUE`. Whether the external component accepts a call by reference or by value parameter is described in the documentation of the external component. It can also be viewed in the Natural Component Browser.
`P` | temporarily protected | `INPUT` `REINPUT` | Used in conjunction with an attribute control variable (Format C), the `DY` parameter (dynamic attributes), and the `REINPUT` statement.

Note
The Field Input/Output Characteristics `A`, `M` and `O` of the `AD` parameter may be also specified in function calls.

## Interpretation of Alphanumeric Fields

Value | Meaning | Statements | Explanation
--- | --- | --- | ---
`Q` | display alphanumeric field as if it were a numeric field | `ASSIGN` `COMPUTE` `MOVE` `DISPLAY` `FORMAT` `INPUT` `PRINT` `REINPUT` `WRITE` | This attribute is available on mainframe computers only. A corresponding hardware feature is required. An alphanumeric field is interpreted as if it were a numeric field. If the field is displayed under the scope of profile or session parameter `PM``=I`, the value of the field is interpreted from left to right instead of right to left.

## Mandatory Input

Value | Meaning | Statements | Explanation
--- | --- | --- | ---
`E` | value mandatory | `INPUT` `FORMAT` | A value must be entered in the field in response to an `INPUT` statement; otherwise an error message will be issued. This is only relevant for input-only fields (`AD=A`).
`F` | value optional | `INPUT` `FORMAT` | A value can, but need not, be entered in the field in response to an `INPUT` statement. This is the default value.

## Length of Input Value

Value | Meaning | Statements | Explanation
--- | --- | --- | ---
`G` | value size | `INPUT` `FORMAT` | The value entered in the field in response to an `INPUT` statement must be of the same length as the field. This is only relevant for input-only fields (`AD=A`).
`H` | value size | `INPUT` `FORMAT` | The value entered in the field in response to an `INPUT` statement may be shorter than the field. This is the default value.

## Field Upper/Lower Case Characteristics

Value | Meaning | Statements | Explanation
--- | --- | --- | ---
`T` | translate lower to upper case | `INPUT` `FORMAT` | The value entered is to be translated to upper case.
`W` | accept lower case | `INPUT` `FORMAT` | Lower case values are to be accepted. `AD=W` is the default value. Note To make `AD=W` effective, you have to specify the value `ON` for the Natural profile parameter `LC`.

## Filler Character

Value | Meaning | Statements | Explanation
--- | --- | --- | ---
`'c'` | filler character | `INPUT` `FORMAT` | The empty field is to be filled with the specified character c (for display only) if `AD=A` (input field, non-protected) or `AD=M` (output field, modifiable) is specified.

Before the value is displayed for a modifiable field (`AD=M`), field positions that are not occupied by the value are filled with the specified filler character as follows:

- Leading or trailing positions (depending on the field alignment) are filled for format I, N and P fields.

- Trailing positions are filled for format A fields.

If the user enters a value in response to the `INPUT` statement, before the value has been assigned to the field,

- both leading and trailing filler characters are removed for format I, N and P fields,

- trailing filler characters are removed for format A fields.

Caution
Filler characters that may occur as part of the value in either leading or trailing position should be avoided to prevent undesired results. For example, if the filler character "0" (zero) is defined for a field of format N5 and the value `00100` is entered as input data, leading and trailing zeroes are removed so that only the value `1` remains, and will be assigned to the field. For the same reason, the minus sign "-" should be avoided as a filler character for numeric fields if negative values are to be entered.

If the filler character is set to blank (`X'40'`), filling blanks are replaced by `X'00'` to allow for insertion of characters without having to clear the remainder of the input field before.

### On this page

- AD Parameter Syntax
- Field Representation
- Field Alignment
- Field Input/Output Characteristics
- Interpretation of Alphanumeric Fields
- Mandatory Input
- Length of Input Value
- Field Upper/Lower Case Characteristics
- Filler Character