🦔
【COBOL】COBOLのCALL・USING・LINKAGE わかりやすく
2倍にするだけのサブルーチン。他のプログラムでのfunctionの役割を持つ
なので純粋なコボラーは他の言語を習得し難い
コード
IDENTIFICATION DIVISION.
PROGRAM-ID. MAIN.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 NUM PIC 9(3) VALUE 111.
PROCEDURE DIVISION.
CALL "SUB" USING NUM.
DISPLAY NUM.
END PROGRAM MAIN.
IDENTIFICATION DIVISION.
PROGRAM-ID. SUB.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DOUBLE PIC 9(3).
LINKAGE SECTION.
01 NUM PIC 9(3).
PROCEDURE DIVISION USING NUM.
MULTIPLY NUM BY 2 GIVING NUM.
END PROGRAM SUB.
結果
222
Discussion