In an INPUT
, DISPLAY
, WRITE
, WRITE
TITLE
or WRITE
TRAILER
statement, you can use text notation to define a text to be used
in conjunction with such a statement.
This document covers the following topics:
Defining a Text to Be Used with a Statement - the 'text' Notation
Defining a Character to Be Displayed n Times before a Field Value - the 'c'(n) Notation
The text to be used with the statement (for example, a prompting message) must be enclosed in either apostrophes (') or quotation marks ("). Do not confuse double apostrophes ('') with a quotation mark (").
Text enclosed in quotation marks can be converted automatically from lower-case letters to upper case. To switch off automatic conversion, change the settings in the editor profile.
For details, see Dynamic Conversion of Lower Case in General Defaults in Editor Profile (General Information, Editors documentation).
The text itself may be 1 to 72 characters and must not be continued from one line to the next.
Text elements may be concatenated by using a hyphen.
DEFINE DATA LOCAL 1 #A(A10) END-DEFINE INPUT 'Input XYZ' (CD=BL) #A WRITE '=' #A WRITE 'Write1 ' - 'Write2 ' - 'Write3' (CD=RE) END
The following applies, if (Translate Quotation
Marks) is set to ON
. This is the default setting.
If you want an apostrophe to be part of a text string that is enclosed in apostrophes, you must write this as double apostrophes ('') or as a quotation mark ("). Either notation will be output as a single apostrophe.
If you want an apostrophe to be part of a text string that is enclosed in quotation marks, you write this as a single apostrophe.
#FIELDA = 'O''CONNOR' #FIELDA = 'O"CONNOR' #FIELDA = "O'CONNOR"
In all three cases, the result will be:
O'CONNOR
The following applies, if the Natural profile parameter TQ
(Translate Quotation Marks)
or the keyword subparameter TQMARK
of the Natural profile parameter
CMPO
is set to OFF
. The default setting is
ON
.
If you want a quotation mark to be part of a text string that is enclosed in single apostrophes, write a quotation mark.
If you want a quotation mark to be part of a text string that is enclosed in quotation marks, write double quotation marks ("").
#FIELDA = 'O"CONNOR' #FIELDA = "O""CONNOR"
In both cases, the result will be:
O"CONNOR
If a single character is to be output several times as text, you use the following notation:
'c'(n)
|
As c you specify the character, and as
n the number of times the character is to be generated. The
maximum value for n
is 249
.
WRITE '*'(3)
Instead of apostrophes before and after the character
c
you can also use quotation marks.