Setup List
A setup list is a string of codes, terminated with a "Z," fully specifying both the logical and physical characteristics of the data elements in a Data List. Specifications include data type, physical data storage bytes, and decimal places for decimal numbers. Each data element is specified with a character string whose length represents the actual bytes of storage the data element occupies and whose value includes data type codes and decimal positions. All data types except decimal numbers use alphabetic characters preceded a number or special character. Consecutive data elements of the same type alternate one of the two characters representing the data type.
The following table summarizes information for the data types supported:
| Data Type | Codes | Length (bytes) | Data List Picture |
|---|---|---|---|
|
Character |
C, H |
1 to 255 |
X through X(255) |
|
Date |
D, A |
10 |
X(10) |
|
Time |
T, E |
26 |
X(26) |
|
Small Integer |
S, M |
2 |
[S]999 or [S]9999 COMP |
|
Large Integer |
I, N |
4 |
[S]9(8) or [S]9(9) COMP |
|
Decimal Number |
d[P...] |
1 to 8 |
[S]9(w)[V9(d)], where d is the number of decimal places, and w is the remaining number of whole number digits, deduced from the total length of the field and the number of decimals. See Examples. d = 0-9 for 0-9 decimal places, |0-|5 for 10-15 decimal places. (The vertical bar character represents the tens digit). Note: Packed decimal numbers are stored two digits (including the sign) per byte. For example, the number PIC S9(9)V9(2) occupies 6 bytes. |
Examples:
This table provides examples of setup lists and their corresponding data lists.
| SETUP List | DATA List |
|---|---|
|
PIC X(5) VALUE ALL 'C' |
PIC X(5) |
|
PIC X(10) VALUE ALL 'D' |
PIC X(10) |
|
PIC XX VALUE ALL 'S' |
PIC S9999 COMP |
|
PIC XXXX VALUE ALL 'I' |
PIC S9(8) COMP |
|
PIC XX VALUE '0P' |
PIC S999 COMP-3 |
|
PIC X(5) VALUE '3PPPP' |
PIC S9(6)V999 COMP-3 |
|
PIC X(8) VALUE '|3PPPPPP' |
PIC S99V9(13) COMP-3 |