PICSPEC
PICSPEC casts data from CHARACTER to PICTURE type.
- x
- Expression.
- y
- Picture specification.
The expression x must be CHARACTER NONVARYING with a length known at compile time.
y must be a character literal that specifies a valid PICTURE with an external representation that has the same length as the first argument.
The result has the PICTURE type specified by the second argument.
Unlike the EDIT built-in function, no conversion is done and no checks are made to see if the first argument holds data valid for the picture.
Like the UNSPEC built-in function, only the "type" of the data is changed.
So, for example given PICSPEC(x,'(5)9'), x must be CHAR(5) (since while the picture specification '(5)9' was 4 characters in length, its external representation requires 5 characters), but x will not be checked to see if it actually contains 5 numeric digits.
A statement of the N = N + PICSPEC(X,'(5)9') will not cause x to be converted from CHAR to PIC'(5)9', a conversion that would require a library call, but will cause the contents of x to be treated as if it were declared as PIC'(5)9'.