PERFORM a paragraph in other file ?

Hi everybody.

I have 2 files as below :

1. MAIN.cbl 

2. SUB.cbl

In MAIN.cbl :

CALL 'SUB'.

PERFORM  HELLO-PAR.

   HELLO-PAR.

   display 'HELLO EVERYBODY'.

In SUB.cbl : I want use HELLO-PAR paragraph and don't want code again it. I try to PERFORM HELLO-PAR but have error.

How do this ? Plz show me. Thanks !  

  • MAIN.cbl:

    working-storage section.

    01  ws-sqlCode pic xxx.

    call 'SUB2' using ws-sqlCode.

    SUB1.cbl:

    working-storage section.

    01  ws-sqlCode pic xxx.

    call 'SUB2' using ws-sqlCode.

    SUB2. cbl.

    linkage section.

    01  sqlCode pic xxx.

    procedure division using ws-sqlCode.

    display 'Error, sql-code =', ws-sqlCode.

    exit program.

  • MAIN.cbl:

    working-storage section.

    01  ws-sqlCode pic xxx.

    call 'SUB2' using ws-sqlCode.

    SUB1.cbl:

    working-storage section.

    01  ws-sqlCode pic xxx.

    call 'SUB2' using ws-sqlCode.

    SUB2. cbl.

    linkage section.

    01  sqlCode pic xxx.

    procedure division using ws-sqlCode.

    display 'Error, sql-code =', ws-sqlCode.

    exit program.