HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)
432 AppendixA
SAMPLE PROGRAMS
COBOL
COBOL
$CONTROL LIST, MAP, VERBS
IDENTIFICATION DIVISION.
PROGRAM-ID. COBOL-EXAMPLE.
*****
***** This application collects employee payroll deduction
***** transactions and places the edited transactions into
***** a file.
*****
***** For this application: Enter key = edit and file
***** transaction;
*****
***** f8 = exit application;
*****
***** all other f keys = redo transaction.
*****
***** Each transaction entered by the operator is subjected to the
***** data edits embedded within the input form.
*****
***** The application continues to collect transactions until either
***** the operator signals to exit or a system error is detected.
*****
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT TXN-ENTRY ASSIGN TO "PAYTXN".
DATA DIVISION.
FILE SECTION.
FD TXN-ENTRY
RECORD CONTAINS 200 CHARACTERS
DATA RECORDS ARE TXN-REC.
01 TXN-REC.
05 FILLER PIC X(200).
WORKING-STORAGE SECTION.
01 COMAREA.
05 CSTATUS PIC S9(4) COMP VALUE 0.
05 LANGUAGE PIC S9(4) COMP VALUE 0.
05 COMAREALEN PIC S9(4) COMP VALUE 0.
05 USERBUFLEN PIC S9(4) COMP VALUE 0.
05 CMODE PIC S9(4) COMP VALUE 0.
05 LASTKEY PIC S9(4) COMP VALUE 0.
05 NUMERRS PIC S9(4) COMP VALUE 0.