Cobol/VSE oddity

New Message Reply Date view Thread view Subject view Author view Other groups

Subject: Cobol/VSE oddity
From: Tony Thigpen (tony@vse2pdf.com)
Date: Thu Aug 06 2009 - 22:36:01 EDT


Someone sent me some sample cobol code for me to test. It was actually 
developed on a non-mainframe platform. What was strange is the mixture 
of single quotes and double quotes and when the compiler accepts them.

I am using CBL QUOTE for the following code snippits.
MOVE 'BTOC' TO TOKEN
MOVE 33     TO BIT-ENTRY(1)

CALL "EZACIC06" USING TOKEN
                       BIT-MASK
                       CHAR-MASK
                       CHAR-MASK-LENGTH
                       RET-CODE
END-CALL
IF RET-CODE NOT EQUAL 0
    DISPLAY 'FAIL: EZACIC06 returned non-zero'
ELSE
    IF CHAR-MASK EQUAL '000000000000000000000000100001'
       DISPLAY "PASS: "
    ELSE
       DISPLAY "FAIL: CHAR-MASK " CHAR-MASK
    END-IF
END-IF
DISPLAY "COMPLETE: "

What is interesting is that the CALL "EZACIC06" line produces a compiler 
error, yet the DISPLAY "COMPLETE: " compiles fine.

Strange. I would have expected the DISPLAYs with the double quotes to 
also produce a compile error, or at least a warning.

-- 

Tony Thigpen


New Message Reply Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Wed Sep 02 2009 - 20:20:08 EDT