cobol program show datatypes

Program which shows the different data declarations (data types) in COBOL

IDENTIFICATION DIVISION.

PROGRAM-ID. PGM1.

AUTHOR. Indus Computer Services.

*TYPE OF DATA DECLARATION IN COBOL

ENVIRONMENT DIVISION.

DATA DIVISION.

WORKING-STORAGE SECTION.

77 NUM PIC 9 VALUE 1.

77 ALPHA PIC A(3) VALUE 'ICS'.

77 ALPHANUM PIC X(20) VALUE 'WELCOME TO ICS'.

77 DEC PIC 9V9 VALUE 3.5.

77 SIGNUM PIC S9 VALUE -5.

PROCEDURE DIVISION.

DISPLAY 'NUMERIC (9) : ' NUM.

DISPLAY 'ALPHAPETS (A): 'ALPHA.

DISPLAY 'ALPHA NUMERIC (X) : ' ALPHANUM.

DISPLAY 'DECIMAL (V) : ' DEC.

DISPLAY 'SIGNED VALUE (S) : ' SIGNUM.

STOP RUN.

0 comments:

Post a Comment