Google
 

Trailing-Edge - PDP-10 Archives - BB-5372D-BM - traffic/demonstration/term.cbl
There is 1 other file named term.cbl in the archive. Click here to see a list.
IDENTIFICATION DIVISION.
PROGRAM-ID. TERM.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
OBJECT-COMPUTER. DECSYSTEM-20.
DATA DIVISION.
WORKING-STORAGE SECTION.
77  ERROR-CODE PIC S9(10) COMP VALUE -1.
77  FUNCTION-CODE PIC S9(10) COMP.
77  RESUM-CONDITION PIC S9(10) COMP VALUE 1.
77  MY-ID PIC X(29) DISPLAY-7.
77  TTY-MSG PIC X(10) DISPLAY-7.
PROCEDURE DIVISION.
START.
	DISPLAY "PROGRAM IDENTIFIER " WITH NO ADVANCING.
	ACCEPT MY-ID.
	ENTER MACRO IPCRID USING MY-ID, ERROR-CODE.
	IF ERROR-CODE NOT = 0  GO TO END-IT.
	DISPLAY " ".
WAIT-FOR-INPUT.
	MOVE 0 TO FUNCTION-CODE.
	ENTER MACRO IPWAIT USING FUNCTION-CODE, RESUM-CONDITION,  ERROR-CODE.
	IF ERROR-CODE NOT = 0  GO TO END-IT.
	IF FUNCTION-CODE = 1
	    GO TO TTY-INPUT.
	IF FUNCTION-CODE = 2
	    DISPLAY "RECEIVED IPCF MESSAGE ????"
	    STOP RUN.
	IF FUNCTION-CODE = 3
	    DISPLAY "GOT TIMEOUT FROM IPWAIT ????"
	    STOP RUN.
	DISPLAY "ILLEGAL FUNCTION RETURNED FROM IPWAIT " FUNCTION-CODE.
TTY-INPUT.
	ACCEPT TTY-MSG.
	IF TTY-MSG = "EXIT"  STOP RUN.
	DISPLAY "WHAT ??".
	GO TO WAIT-FOR-INPUT.
END-IT.
	DISPLAY " ERROR CODE IS " ERROR-CODE.
	DISPLAY " ".
	STOP RUN.