Picture Formats

Code data structures in the Data Structure Editor format, which is a shorthand syntax.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

Format

Generated COBOL

9
PIC 9.
99
PIC 99
999
PIC 999
9999
PIC 9999
9(n)
PIC 9(n)
9n
PIC 9(n)
9&variable
PIC 9(&variable)
A
PIC A.
AA
PIC AA.
AAA
PIC AAA.
A(n)
PIC A(n).
An
PIC A(n).
A&variable
PIC A(&variable).
C
PIC S9 COMP.
C(n)
PIC S9(n) COMP.
Cn
PIC S9(n) COMP.
C-3
PIC S9 COMP-3.
Cn-3
PIC S9(n) COMP-3.
C&variable
PIC S9(&variable) COMP.
C&variable+-3
PIC S9(&variable) COMP-3.
F|FULL
PIC S9(9) COMP.
H|HALF
PIC S9(4) COMP.
I|INDEX
INDEX.  (For [USAGE IS] INDEX)
N
PIC 9.
N(n)
PIC 9(n).
Nn
PIC 9(n).
N&variable
PIC 9(&variable).
P|POINTER
POINTER.
 
                              				  
(For COBOL/2 only:  [USAGE IS] POINTER.)
R|REDEF| 
REDEFINES
REDEFINES dataname.
S
PIC S9.
S(n)
PIC S9(n).
Sn
PIC S9(n).
S&variable
PIC S9(&variable).
SYNC
SYNCHRONIZED
V(n)
PIC V9(n).
Vn
PIC V9(n).
V&variable
PIC V9(&variable).
Vvalueclause
VALUE valueclause.
X
PIC X.
XX
PIC XX.
XXX
PIC XXX.
XXXX
PIC XXXX.
Xn
PIC X(n).
X(n)
PIC X(n).
X&variable
PIC X(&variable).
... 

Continuation of a format

General Rules:

  1. Application generation treats most format specifications beginning with COBOL edit mask characters as a valid COBOL formats, and passes them directly to the generated program. However, AMB translates an A, followed by a numeral, as follows.
    A8  generates  PIC A(8).
    
  2. Enter only the level 66, 77, or 88 numbers; do not enter other level numbers, such as 01, 05.
  3. Enter one data element name per line only. A data element name can be a valid COBOL name of 1 - 30 characters, or expression introduced by one of the Customizer default symbols.
  4. You do not need to code the word PICTURE in a picture clause. A PICTURE clause format can be a valid COBOL format or a AMB Data Structure Editor shorthand picture format.
  5. If you do code the PICTURE or PIC, use only valid COBOL syntax within the PIC clause - do not use the AMB shorthand picture format.
  6. You can continue the data structure on multiple lines wherever a space occurs, for example:
    WORK1-FIELD1      X(13)
    ... V'13 CHARS LONG'
    WORK1-FIELD2      X(120)
    ... VALUE 'A LONG LITERAL MAY
    ...  BE CONTINUED ON ONE OR
    ...  MORE LINES'
    
  7. AMB treats the Data Structure Editor formats 99, A9,N9,S9, and V9 as valid COBOL formats and passes them directly to the generated program (as PIC 99, PIC A9, and so on). If, however, you want the generated COBOL to be PIC 9(9), PIC V(9), and PIC A(9), use the Data Structure Editor formats 9(9), V(9), and A(9).
  8. If a format includes an Customizer variable followed by additional format syntax, use a plus sign (+) to separate the Customizer variable from the additional syntax. During processing, AMB eliminates the plus sign and concatenates the suffix onto the syntax. For example:
    9&variable+V5 generates PIC 9(&variable)V9(5).
    
  9. Distinguish Vvalueclause from V as an implied decimal point.
    • For Vvalueclause, precede the V with a space and immediately follow it with the valueclause.
    • For V as an implied decimal point, use no space before or after the V. For example:
      N8V4 generates PIC 9(8) V9(4). 
      N8 V4 generates PIC 9(8) VALUE 4.
      
  10. Never code comments within Data Structure Editor constructs.

Example:

The following illustrates using indentation to create level numbers:

Data Structure Editor code

000001        PROG-SPECIFIC-WORKING-DATA
000002          PGWS-FIELD1
000003              PGWS-FIELD2
000004                  PGWS-FIELD3
000005                      PGWS-FIELD4
000006                          PGWS-FIELD5
000007                              PGWS-FIELD6
000008                                  PGWS-FIELD7 X13 

000009                                  ... V'ABCDEFGHIJKL'
000010                  PGWS-FIELD8
000011                      PGWS-FIELD9
000012                          PGWS-FIELD10  N13

Generated COBOL code

01  PROG-SPECIFIC-WORKING-DATA.
    05  PGWS-FIELD1.
        10  PGWS-FIELD2.
            15  PGWS-FIELD3.
                20  PGWS-FIELD4.
                    25  PGWS-FIELD5.
                        30  PGWS-FIELD6.
                            35  PGWS-FIELD7
                                PIC X(13)
                                VALUE 'ABCDEFGHIJKL'.
            15  PGWS-FIELD8.
                20  PGWS-FIELD9.
                    25  PGWS-FIELD10
                                PIC 9(13).