Google
 

Trailing-Edge - PDP-10 Archives - BB-5372D-BM - traffic/demonstration/myform.cbl
There is 1 other file named myform.cbl in the archive. Click here to see a list.
IDENTIFICATION DIVISION.
PROGRAM-ID. MYFORM.
 
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MYFORM-RECORD DISPLAY-7.
*******************************************************
* RECORD DESCRIPTION OF FORM MYFORM
*******************************************************
    10  CN-PROT          PICTURE X(16).
    10  CN-UNPROT        PICTURE S9(7).
    10  CNA-PROT         PICTURE X(16).
    10  CNA-UNPROT       PICTURE X(25).
    10  SA-PROT          PICTURE X(16).
    10  SA-UNPROT        PICTURE X(25).
    10  C-PROT           PICTURE X(4).
    10  C-UNPROT         PICTURE X(12).
    10  S-PROT           PICTURE X(5).
    10  S-UNPROT         PICTURE A(2).
    10  Z-PROT           PICTURE X(3).
    10  Z-UNPROT         PICTURE S9(5).
    10  Q-PROT           PICTURE X(40).
    10  Q-UNPROT         PICTURE A(1).
 
01 FORM-CONTROL.
   03 THE-ERROR PIC S9(10) COMP.
   03 THE-FORM  PIC S9(10) COMP VALUE 0.
   03 END-INDICATOR PIC S9(10) COMP.
 
01 DONE-FLAG   PIC X.
01 SECTION-NUMBERS.
   03 SECTION-1 PIC S9(10) COMP VALUE -1.
   03 SECTION-2 PIC S9(10) COMP VALUE -2.
   03 SECTION-3 PIC S9(10) COMP VALUE -3.
 
PROCEDURE DIVISION.
 
*    update the customer information
 
    PERFORM GET-CUSTOMER-NUMBER.
    PERFORM DISPLAY-CUSTOMER-INFORMATION.
    MOVE 'N' TO DONE-FLAG.
    PERFORM UPDATE-INFORMATION UNTIL DONE-FLAG = 'Y'
    PERFORM CLEAR-SCREEN.
    STOP RUN.
 
GET-CUSTOMER-NUMBER.
 
*  initialize section 1
 
    ENTER MACRO TFRINI USING MYFORM-RECORD,
	  "MYFORM.FORM-DATA",
	  SECTION-1,
	  THE-ERROR.
 


*   read section 1
 
    ENTER MACRO TFRRD USING SECTION-1,
	 END-INDICATOR,
	 THE-ERROR.
 
DISPLAY-CUSTOMER-INFORMATION.
 
 
*pretend to read the customer record from the file
 
    MOVE "DIGITAL EQUIPMENT CORP." TO CNA-UNPROT.
    MOVE "400 TREE ROAD" TO SA-UNPROT.
    MOVE "MARLBORO" TO C-UNPROT.
    MOVE "MA" TO S-UNPROT.
    MOVE 1751 TO Z-UNPROT.
 
*  display section-2 on the screen
 
    ENTER MACRO TFRWRT USING SECTION-2,
	  THE-ERROR.
UPDATE-INFORMATION.
 
*  initialize and read section 3
 
    ENTER MACRO TFRINI USING MYFORM-RECORD,
	  "MYFORM.FORM-DATA",
	  SECTION-3,
	  THE-ERROR.
 
    ENTER MACRO TFRRD USING    SECTION-3,
	 END-INDICATOR
	 THE-ERROR.
 
*if operator wants to change something allow it
 
    IF Q-UNPROT = 'Y'
       ENTER MACRO TFRCLR USING SECTION-3,
	 THE-ERROR
       ENTER MACRO TFRRD USING SECTION-2,
	END-INDICATOR,
	THE-ERROR
     ELSE
       MOVE 'Y' TO DONE-FLAG.

CLEAR-SCREEN.

*clear the screen
    ENTER MACRO TFRCLR.
END-OF-PROGRAM.