Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/demos/eat.cbl
There are no other files named eat.cbl in the archive.
IDENTIFICATION DIVISION.
PROGRAM-ID. CBLMIR.
AUTHOR. PETER MIERSWA.
INSTALLATION. DIGITAL MARLBORO.
REMARKS.
	THIS TASK EATS EVERYTHING SENT TO IT.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 NETLN PIC S9(10) COMP VALUE 0.
01 N-TYPE PIC S9(10) COMP VALUE 0.
01 DESC PIC X(40) DISPLAY-7 VALUE SPACE.
01 WAIT PIC S9(10) COMP VALUE 0.
01 RETCOD PIC S9(10) COMP VALUE 0.
01 EOM PIC S9(10) COMP VALUE 0.
01 N-COUNT PIC S9(10) COMP VALUE 0.
01 DATA-RECORD PIC X(5000) DISPLAY-7.
01 N-CODE PIC S9(10) COMP VALUE 0.
PROCEDURE DIVISION.
START.

* OPEN THE NETWORK FILES *

	MOVE "SRV:.EAT" TO DESC.
	CALL NFOPN USING NETLN,0,DESC,7,0,RETCOD.

MAIN-LOOP.
	MOVE -1 TO NETLN.
	CALL NFGND USING NETLN,1,RETCOD.
	IF RETCOD EQUALS 1 GO TO DO-NFACC.
	IF RETCOD EQUALS 2 OR 5 GO TO DO-NFCLS.
	IF RETCOD EQUALS 3 GO TO DO-NFRCI.
	IF RETCOD EQUALS 4 GO TO DO-NFRCV.
	DISPLAY "?ERROR IN NFGND, RETURN CODE = ",RETCOD.
	STOP RUN.

DO-NFACC.
	MOVE SPACES TO DATA-RECORD.
	CALL NFACC USING NETLN,0,DATA-RECORD,RETCOD.
	GO TO MAIN-LOOP.


DO-NFRCV.
	display "GOT THE INTERRUPT".
	MOVE SPACES TO DATA-RECORD.
	MOVE 5000 TO N-COUNT.
	CALL NFRCV USING NETLN,N-COUNT,DATA-RECORD,1,0,RETCOD.
	DISPLAY "RECEIVED RECORD OF ",N-COUNT," BYTES RET=",RETCOD.
	GO TO MAIN-LOOP.


DO-NFCLS.
	CALL NFCLS USING NETLN,0,0,0,DATA-RECORD,RETCOD.
	MOVE "SRV:.EAT" TO DESC.
	CALL NFOPN USING NETLN,0,DESC,7,0,RETCOD.
	GO TO MAIN-LOOP.

DO-NFRCI.
	CALL NFRCI USING NETLN,N-COUNT,DATA-RECORD,RETCOD.
	DISPLAY "Interrupt message => ",DATA-RECORD.
	GO TO MAIN-LOOP.