>>SOURCE FORMAT IS FREE *> cobol-picture-clause-9-x-a-v-s.cob - PICTURE symbols 9, X, A, V, S and P, *> and what a numeric item looks like in storage *> Dialect: GnuCOBOL 3.x, free format *> Status : desk-checked against the GnuCOBOL 3.2 Programmer's Guide; *> compiled and run with GnuCOBOL 3.2 on 2026-10-29 *> Inputs : none *> Outputs: nine lines on standard output *> Build : cobc -x cobol-picture-clause-9-x-a-v-s.cob *> Run : ./cobol-picture-clause-9-x-a-v-s *> (Windows: cobol-picture-clause-9-x-a-v-s.exe) IDENTIFICATION DIVISION. PROGRAM-ID. PICTURE-DEMO. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-Unsigned-Int PIC 9(5). 01 WS-Signed-Int PIC S9(5). 01 WS-Unsigned-Dec PIC 9(3)V99. 01 WS-Signed-Dec PIC S9(3)V99. 01 WS-Alnum PIC X(10). 01 WS-Alpha PIC A(5). 01 WS-Scaled PIC 9(3)P(3). *> A numeric item and an alphanumeric view of the same five bytes. 01 WS-Raw-Holder. 05 WS-Raw-Number PIC 9(3)V99 VALUE 123.45. 01 WS-Raw-Bytes REDEFINES WS-Raw-Holder PIC X(5). PROCEDURE DIVISION. MAIN-PARAGRAPH. MOVE 42 TO WS-Unsigned-Int MOVE -42 TO WS-Signed-Int MOVE 3.14159 TO WS-Unsigned-Dec MOVE -0.5 TO WS-Signed-Dec MOVE "COBOL" TO WS-Alnum MOVE "ABC" TO WS-Alpha MOVE 128000 TO WS-Scaled DISPLAY "PIC 9(5) : " WS-Unsigned-Int DISPLAY "PIC S9(5) : " WS-Signed-Int DISPLAY "PIC 9(3)V99 : " WS-Unsigned-Dec DISPLAY "PIC S9(3)V99 : " WS-Signed-Dec DISPLAY "PIC X(10) : [" WS-Alnum "]" DISPLAY "PIC A(5) : [" WS-Alpha "]" DISPLAY "PIC 9(3)P(3) : " WS-Scaled DISPLAY "9(3)V99 holding 123.45, as numeric : " WS-Raw-Number DISPLAY "9(3)V99 holding 123.45, raw bytes : [" WS-Raw-Bytes "]" STOP RUN.