This form of the INPUT
statement is used to create a layout
of an INPUT
screen, or to create an INPUT
data layout
which is to be read in batch mode from a sequential input file.
INPUT
|
[WINDOW=' window-name' ] [NO ERASE ]
|
||||||||||||||||
[( statement-parameters) ]
|
|||||||||||||||||
[WITH-TEXT-option] | |||||||||||||||||
[MARK-option] | |||||||||||||||||
[ALARM-option] | |||||||||||||||||
[( attributes) ]
|
|||||||||||||||||
operand1
[( parameter) ]
|
This document covers the following topics:
For an explanation of the symbols used in the syntax diagram, see Syntax Symbols.
Operand Definition Table:
Operand | Possible Structure | Possible Formats | Referencing Permitted | Dynamic Definition | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operand1 | S | A | G | N | A | U | N | P | I | F | B | D | T | L | G | yes | yes |
Syntax Element Description:
Syntax Element | Description |
---|---|
INPUT
WINDOW='window-name' |
INPUT WINDOW='window-name'
Option:
With this option, you indicate that the The specified window is only active for the duration of that
See also the statements |
NO
ERASE |
NO ERASE Option:
This option causes a screen map of an Screen as used here refers to a logical screen rather than a physical screen. All unprotected fields that existed on the screen are converted to protected (display only) fields. The old data remain on the screen until the new layout is displayed. If a field from the new screen content partially overlays an existing field, the one character before the new field and the next character in the existing field will be replaced by a blank. |
statement-parameters |
Statement Parameter(s):
One or more parameters, enclosed within parentheses, may be
specified immediately after the For a list of parameters that can be specified with the
Each parameter specified in this manner will override any previous
parameter specified in a The parameter settings applied here will only be regarded for variable fields, but they have no effect on text-constants. If you would like to set field attributes for a text-constant, they have to be set explicitly for this element. Example: DEFINE DATA LOCAL 1 VARI (A4) INIT <'1234'> /* Displays END-DEFINE /* as FORMAT AD=M /* --------- INPUT 'Text' VARI /* Text 1234 INPUT (PM=I) 'Text' VARI /* Text 4321 INPUT 'Text' (PM=I) VARI (PM=I) /* txeT 4321 INPUT 'Text' (PM=I) VARI /* txeT 1234 END Examples of using parameters at the statement and element level are provided below. |
WITH
TEXT-option |
WITH TEXT Option: This option is used
to provide text which is to be displayed in the message line; see
WITH TEXT Option
below.
|
MARK-option |
MARK Option:
See the section MARK Option below. |
ALARM-option |
Alarm Option:
See the section Alarm Option below. |
Other syntax elements
(nX ,
nT ,
x/y ,
operand1 , etc.)
|
Field Positioning, Text Specification, Attribute
Assignment:
See the section Field Positioning, Text Specification, Attribute Assignment below. |
Parameters that can be specified with the INPUT statement | Specification (S = at statement level, E = at element level) | |
---|---|---|
AD
|
Attribute Definition | SE |
AL
|
Alphanumeric Length for Output | SE |
BX
|
Box Definition | SE |
CD
|
Color Definition | SE |
CV
|
Control Variable | SE |
DF
|
Date Format | SE |
DL |
Display Length for Output | SE |
DY
|
Dynamic Attributes | SE |
EM
|
Edit Mask | SE |
EMU |
Unicode Edit Mask | E |
FL
|
Floating Point Mantissa Length | SE |
HE
|
Helproutine | SE |
IP
|
Input Prompting Text | SE |
LS
|
Line Size | S |
MC
|
Multiple-Value Field Count | S |
MS
|
Manual Skip | S |
NL
|
Numeric Length for Output | SE |
PC
|
Periodic Group Count | S |
PM
|
Print Mode | SE |
PS
|
Page Size * | S |
SB
|
Selection Box | E |
SG
|
Sign Position | SE |
ZP
|
Zero Printing | SE |
* If the number of occurrences of an array exceeds the
PS
value, a NAT0303 error will be output.
The individual session parameters are described in the Parameter Reference.
[WITH ]
TEXT
|
[(attributes)][,operand3] 7 |
Operand Definition Table:
Operand | Possible Structure | Possible Formats | Referencing Permitted | Dynamic Definition | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operand1 | C | S | N | P | I | B* | yes | yes | |||||||||||
operand2 | C | S | A | yes | yes | ||||||||||||||
operand3 | C | S | A | N | P | I | F | B | D | T | L | yes | yes |
* Format B of operand1
may be
used only with a length of less than or equal to 4.
WITH TEXT
is used to provide text which is to be displayed
in the message line. This is usually a message indicating what action should be
taken to process the screen or to correct an error.
Syntax Element Description:
Syntax Element | Description |
---|---|
operand1
|
Message Text Number:
You can retrieve either user-defined messages or Natural system messages:
See also Example 4 - WITH TEXT
Options in the description of the |
operand2
|
Message Text:
See also Example 4 - WITH TEXT
Options in the description of the |
attributes
|
Output Attributes:
It is possible to assign various output attributes for operand1/2. These attributes and the syntax that may be used are described in the section Output Attributes below. |
operand3
|
Dynamic Replacement of Message Text:
The values provided are used to replace parts of a message text
that are either specified with The notation See also Example 4 - WITH TEXT
Options in the description of the Note: Leading zeros or trailing blanks will be removed from the field value before it is displayed in a message. |
attributes indicates the output attributes to be used for text display. Attributes can be:
ad-value |
Where:
ad-value
,
bx-value
,
cd-value
and
pm-value
denote the possible values of
the corresponding session parameters AD
,
BX
,
CD
and
PM
described
in the relevant sections of the Parameter Reference
documentation.
The compiler actually accepts more than one attribute value for an output
field. For example, you can specify: AD=BDI
. In such a case,
however, only the last value applies. In the given example, only the value
I
becomes effective and the output field is displayed
intensified.
For an alphanumeric/Unicode constant (Natural data format A or U), you can
specify ad-value
and/or
cd-value
without preceding
CD=
or AD=
, respectively. The single value entered is
then checked against all possible CD
values first. For
example: a value of IRE
will be interpreted as intensifed/red but
not as intensified/right-justified/mandatory. You cannot combine a single
cd-value
or
ad-value
with a value preceded by
CD=
or AD=
.
With the MARK
option, you can cause the cursor to be
placed at any non-protected field on screen. In addition, you can specify the
position of the cursor within that field. By default, that is, when the
MARK
option is omitted, the cursor is placed at the beginning of
the first non-protected field.
MARK [POSITION
operand4
[IN ]] [FIELD ]
|
Operand Definition Table:
Operand | Possible Structure | Possible Formats | Referencing Permitted | Dynamic Definition | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operand4
|
C | S | N | P | I | yes | yes | ||||||||||||
operand1
|
C | S | A | N | P | I | yes | yes |
Syntax Element Description:
Syntax Element | Description |
---|---|
operand1
|
Field Reference Number:
Each field attribute |
*fieldname
|
Field Name for Referencing:
Instead of the field reference number, the field name may be used
to position to a field, using the
|
operand4
|
Cursor Position within Referenced
Field:
With
|
MARK #NUMBER /* Field number MARK 3 /* Third map field MARK *#FIELD1 /* Map field MARK POSITION 3 IN #NUMBER /* Third character in field number
See also Example 3 - INPUT Statement with MARK POSITION Option at the end of this section.
This option causes the sound alarm feature of the terminal to be
activated when the INPUT
statement is executed. The appropriate
hardware must be available to be able to use this feature.
[AND ] [SOUND ] ALARM |
Unless the session parameter IP
(input prompting)
is set to IP=OFF
, the field name of the field used in an
INPUT
statement will be displayed preceding the field value (forms
mode) or as a prompting keyword to select the field (keyword/delimiter mode).
This default field name may be overridden by specifying either a
'text'
element (which replaces the
default name) or '-'
(which suppresses the display of the default
field name) immediately preceding the field name.
Several notations are available for field positioning, attribute assignment, and text creation.
Syntax Element Description:
Syntax Element | Description |
---|---|
nX
|
Insert Option:
This option causes n spaces to be inserted between fields. Note: |
n T
|
Tabulator Option:
This option causes positioning (tabulation) to print position n. |
x/y
|
Positioning Option:
Places the next element on line x, beginning in column y. y must not be zero. Backward positioning in the same line is not permitted. |
'text'
|
Write Protection:
Causes text to be displayed write protected; see also Text Notation, Defining a Text to Be Used with a Statement. |
'c'
(n)
|
Character Repetition:
Identical to |
attributes
|
Display Attributes:
Attributes to be used for display. See Attributes below. |
'-'
|
Minus Sign:
When placed before a field, Note: |
'='
|
Equal Sign:
When placed before a field, |
'/'
|
Slash Sign:
When placed between fields or text elements, The contents of fields may be specified for input, output only,
and output for modification using the attribute settings
Example: INPUT #A (AD=A) #B (AD=O) #C (AD=M)
|
*IN, *OUT and *OUTIN
|
Field Attribute Definition:
Equivalent to the attributes Note: |
operand1
|
Field(s) to be Used:
Natural directly maps the content of each field from the data area
to the When the content of a database field is modified as a result of
When the name of a group of database fields is referenced in an
When reference is made to a range of occurrences within an array, all occurrences are individually processed as input fields, but no prompting text will be created for each individual occurrence, only for the first one. On mainframe computers, arrays with ranges that allow to vary the number of occurrences at execution time may not be specified. |
parameter(s) |
Parameter(s):
One or more parameters, enclosed within parentheses, may be
specified immediately after Each parameter specified will override any previous parameter
specified in a The parameter settings applied here will only be regarded for variable fields, but they have no effect on text constants. If you would like to set field attributes for a text-constant, they have to be set explicitly for this element. For information on the individual parameters, see the table in the section Statement Parameters. Note: |
The following attributes may be used:
B
|
BL
|
T
|
||||||||||||||||||||||
C
|
GR
|
B
|
C
|
|||||||||||||||||||||
D
|
NE
|
L
|
D
|
|||||||||||||||||||||
[AD= ]
|
I
|
[CD= ]
|
PI
|
[BX= ]
|
R
|
[PM= ]
|
I
|
|||||||||||||||||
N
|
RE
|
ON
|
N
|
|||||||||||||||||||||
U
|
TU
|
OFF |
||||||||||||||||||||||
V
|
YE
|
|||||||||||||||||||||||
1 | 2 | 3 | 4 |
Display attributes; see the session parameter
AD
(in the
Parameter Reference).
Color attributes; see the session parameter
CD
(in the
Parameter Reference).
Outlining attributes; see the session parameter
BX
(in the
Parameter Reference).
Print mode attributes; see the session parameter
PM
(in the
Parameter Reference).
** Example 'IPTEX1': INPUT ************************************************************************ DEFINE DATA LOCAL 1 #FNC (A1) END-DEFINE * INPUT 10X 'SELECTION MENU FOR EMPLOYEES SYSTEM' / 10X '-' (35) // 10X 'ADD (A)' / 10X 'UPDATE (U)' / 10X 'DELETE (D)' / 10X 'STOP (.)' // 10X 'PLEASE ENTER FUNCTION: ' #FNC * DECIDE ON EVERY VALUE OF #FNC VALUE 'A' /* invoke the object containing the add function here WRITE 'Add function selected.' VALUE 'U' /* invoke the object containing the update function here WRITE 'Update function selected.' VALUE 'D' /* invoke the object containing the delete function here WRITE 'Delete function selected.' VALUE '.' STOP NONE REINPUT 'Please enter a valid function.' MARK *#FNC END-DECIDE * END
SELECTION MENU FOR EMPLOYEES SYSTEM ----------------------------------- ADD (A) UPDATE (U) DELETE (D) STOP (.) PLEASE ENTER FUNCTION:
** Example 'INPEX1': INPUT (with DEFINE WINDOW statement) ************************************************************************ DEFINE DATA LOCAL 1 #STRING (A15) END-DEFINE * DEFINE WINDOW WIND1 SIZE 10 * 40 BASE 5 / 10 FRAMED ON POSITION TEXT * INPUT WINDOW='WIND1' 'PLEASE ENTER HERE:' / #STRING * END
+----------------------------------Top+ ! PLEASE ENTER HERE: ! ! #STRING ! ! ! ! ! ! ! ! ! ! ! ! ! +-------------------------------Bottom+
** Example 'INPEX2': INPUT (with POSITION) ************************************************************************ DEFINE DATA LOCAL 1 #START (A30) END-DEFINE * ASSIGN #START = 'EXAM_' * INPUT (AD=M) MARK POSITION 5 IN *#START / 'PLEASE COMPLETE START VALUE FOR SEARCH' / 5X #START END
PLEASE COMPLETE START VALUE FOR SEARCH #START EXAM[]