|
In COBOL programming, a picture clause is used for data description. The COBOL PICTURE (PIC) and USAGE are used to determine the data type and its corresponding SAS INFORMAT. The X represents character values and a 9 is the numeric values which also contains a S to indicate that the value is SIGNED and a V to show the location of an implied decimal point.
Picture using a 9 that also contains a USAGE or an S (signed) indicate the non-standard numeric type of the value. The term non-standard numeric refers to numeric values such as PACKED DECIMAL (PD), ZONED DECIMAL (ZD), REAL BINARY (PIB) and INTEGER BINARY (IB).
The COBOL PICTURE describes the actual width of the value by the number of X's or 9's or by the number within the parentheses after the X or 9. For example, a character value with a width of 5 is specified as PIC XXXXX or PIC X(5).
The following table describes of how the COBOL PICTURE and USAGE correspond to SAS INFORMAT. The native system indicates the value is being read on the same system that was created. Non-native indicates the value is in IBM mainframe format and is being read on a different non-IBM system.
|
|
COBOL Picture
- PIC X(n)
- PIC 9(int)V9(fract)
- PIC 9(int)V9(fract) COMP-3
- PIC S9(int)V9(fract) COMP-3
- PIC 9(int)V9(fract) DISPLAY
- PIC S9(int)V9(fract) DISPLAY
- PIC S9(int)V9(fract) DISPLAY SIGN LEADING
- PIC S9(int)V9(fract) DISPLAY SIGN LEADING SEPARATE
- PIC S9(int)V9(fract) DISPLAY SIGN TRAILING SEPARATE
- PIC 9(int)V9(fract) COMP
- PIC S9(int)V9(fract) COMP
- no picture but usage COMP-1
- no picture but usage COMP-2
|
Native System Informat
- $w. or $CHARw.
- w.d
- PK or S370FPDU
- PD
- S370FZDU
- ZD
- S370FZDL
- S370FZDS
- S370FZDT
- S370FIBU
- IB or PIB
- RB4.
- RB8.
|
Non-Native System Informat
- $EBCDICw.
- S370FF
- PK or S370FPDU
- S370FPD
- S370FZDU
- S370FZD
- S370FZDL
- S370FZDS
- S370FZDT
- S370FIBU
- S370FIB or S370FPIB
- S370FRB4.
- S370FRB8.
|
|
|
|
If the picture contains a SIGNED numeric without a USAGE, the USAGE type is DISPLAY.
The PK and S370FPDU INFORMAT both read unsigned packed decimal. The difference is that PK reads values which do not contain a sign bit and that S370FPDU reads IBM mainframe values which always contain an F as the sign in the right-most bit.
The S370FIBU INFORMAT reads unsigned integer binary values that are stored in IBM mainframe format. The PIB INFORMAT reads positive integer binary values, treats all values as positive and includes the sign bit as part of the value. The S370FPIB INFORMAT reads positive integer binary values that stored in IBM mainframe format, treats all values as positive and includes the sign bit as part of the value.
The following chart is to determine the correct width and decimal specification of how to use with the SAS INFORMAT.
|
|
Usage
- DISPLAY (Zoned Decimal)
- COMP-3 (Packed Decimal)
- COMP (Integer Binary):
if 1<=(int+fract)<=4 if 5<=(int+fract)<=9 if 10<=(int+fract)<=18
|
Width
- (int+fract)
- CEIL (int+fract+1/2)
2 4 8
|
Decimal
- (fract)
- (fract)
(fract) (fract) (fract)
|
|
|
|