Pic

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

|********************************* TOP OF DATA ********************************|

|
*** PICTURE CLAUSE ***
|
|
|
| The PICTURE clause is an optional clause which can be specified as part
|
| of a data description entry. It specifies the general characteristics
|
| and editing requirements for an elementary data item.
|
|
|
| The PICTURE clause is formatted as shown below:
|
|
|
|
PICTURE/PIC {IS} character-string
|
|
|
| The PICTURE clause must be specified for every elementary item other
|
| than an index item and the subject of a RENAMES clause. It may not be
|
| specified for a group item.
|
|
|
| The PICTURE character-string is made up of certain COBOL characters
|
| used as symbols. Up to 30 of these symbols may be used within a single
|
| PICTURE character-string. The symbols actually used within a given
|
| PICTURE character-string determine the category of the elementary data
|
| item being described.
|
|
|
| A list of all the PICTURE clause symbols and their meanings is shown
|
| below:
|
|
|
|
SYMBOL
MEANING
|
|
------------------------------------------------------------|
|
|
|
A
A character position that can contain only an alphabetic
|
|
character (A-Z) or a space.
|
|
|
|
B
A character position into which the space character is
|
|
inserted. For an DBCS item (i.e., as an IBM extension),
|
|
each B represents 2 character positions into which a
|
|
DBCS space is inserted.
|
|
|
|
E
Provided as an IBM extension to mark the start of the
|
|
exponent in an external floating-point item. Occupies 1
|
|
byte of storage.
|
|
|
|
G
Provided as an IBM extension to specify a Double Byte
|
|
Character Set character position, occupying 2 bytes of
|
|
storage. Cannot be specified for a non-DBCS item.
|
|
|
|
P
An assumed decimal scaling position. It is used to
|
|
specify the location of an assumed decimal point when
|
|
the point is not within the number that appears in the
|
|
data item.
|
|
|
|
S
Indicates the presence of an operational sign. (An
|
|
operational sign indicates whether or not an item is
|
|
negative or positive.) It must appear as the leftmost
|
|
character in the PICTURE string (but this does not
|
|
necessarily indicate the position of the sign within the
|
|
data item). The symbol S is not counted in determining
|
|
the size of the item (unless an associated SIGN clause
|
|
includes the SEPERATE CHARACTER phrase).
|
|
|
|
V
Indicates the location of an assumed decimal point. It
|
|
does not represent a character position and is not
|
|
counted in the size of the item. If not specified, the
|

|
assumed decimal point is considered to be to the right
|
|
of the rightmost symbol in the string.
|
|
|
|
X
A character position that may contain any character.
|
|
|
|
Z
A leading numeric character position which is replaced
|
|
by a space when that position contains a zero.
|
|
|
|
9
A leading character position that contains a numeral.
|
|
|
|
0
A character position into which the numeral zero is
|
|
inserted.
|
|
|
|
/
A character position into which the slash character is
|
|
inserted.
|
|
|
|
,
A character position into which a comma is inserted.
|
|
|
|
.
A character position into which a period is inserted.
|
|
It also represents the decimal point for alignment
|
|
purposes.
|
|
|
|
+
The character position (or positions) into which the
|
|
editing sign control character is to be placed. Only
|
|
CR
one of these 4 symbols can be used in a given PICTURE
|
|
DB
character-string. Each character used in the symbol is
|
|
counted in determining the size of the data item (i.e.,
|
|
CR and DB each count as 2 bytes).
|
|
|
|
*
A leading numeric character position into which an
|
|
asterisk is placed when that position contains a zero.
|
|
|
|
$
A character position into which a currency symbol is
|
|
placed.
|
|
|
| The symbols shown below may appear more than once in a given PICTURE
|
| character-string:
|
|
|
|
A B G P X Z 9 0 / , + - * $
|
|
|
| If any of these symbols appears in a PICTURE character-string
|
| immediately followed by an unsigned integer enclosed in parentheses,
|
| then that integer specifies the number of consecutive occurances of the
|
| symbol within that PICTURE character-string.
|
|
|
| As an example, all of the PICTURE clauses shown below are equivalent:
|
|
|
|
PICTURE S99999V99
|
|
PICTURE S9(5)V9(2)
|
|
PICTURE S9(5)V99
|
|
PICTURE S99999V9(2)
|
|
PICTURE S9(05)V9(02)
|
|
|
| For more details on the PICTURE clause, see DATA CLASSES, DATA
|
| CATEGORIES, and PICTURE CLAUSE EDITING.
|
|******************************* BOTTOM OF DATA *******************************|

You might also like