IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-WORLD. DATA DIVISION. WORKING-STORAGE SECTION. 01 V1 PIC X(50). 01 CNT PIC 9(3). 01 V2 PIC X(50) VALUE 'BB'. PROCEDURE DIVISION. DISPLAY 'Hello, World!'. MOVE 'AA BB CD CDEF ' to V1 move 'BB' to v2 initialize cnt display 'V1=' V1 display 'V2=' V2 inspect V1 tallying cnt for all V2 . display 'CNT=' cnt STOP RUN.
Write, Run & Share Cobol code online using OneCompiler's Cobol online compiler for free. It's one of the robust, feature-rich online compilers for Cobol language. Getting started with the OneCompiler's Cobol editor is easy and fast. The editor shows sample boilerplate code when you choose language as Cobol and start coding.