#COMPILE EXE
#DIM ALL

FUNCTION PBMAIN() AS LONG
    LOCAL buf AS STRING * 20
    buf = "hello"
    #COBOL USING buf
       IDENTIFICATION DIVISION.
       PROGRAM-ID. SetBuf.
       DATA DIVISION.
       LINKAGE SECTION.
       01 BUF PIC X(20).
       PROCEDURE DIVISION USING BUF.
           MOVE "from COBOL" TO BUF.
           STOP RUN.
    #ENDCOBOL
    PRINT buf
    FUNCTION = 0
END FUNCTION
