═══ 1. IDENTIFICATION DIVISION ═══ IDENTIFICATION DIVISION. PROGRAM-ID. HYPRDEMO. *********************************************** * * * H Y P E R D E M O * * * *********************************************** * * * PURPOSE: DEMONSTRATE THE FUNCTIONS OF THE * * COBOL HYPERCODE FACILITY. * * * * DESCRIPTION: THIS PROGRAM READS A FLAT * * FILE CONTAINING CUSTOMER * * RECORDS AND GENERATES A * * REPORT TO BE PRINTED OUT * * ON MAILING LABELS. IN * * ADDITION, THE RECORDS ARE * * WRITTEN TO AN INDEXED FILE * * FOR SUBSEQUENT PROCESSING. * *********************************************** AUTHOR. CASEy Software. *COPY COPYRITE. *********************************************** * * * (c)Copyright 1994, CASEy Software * * * *********************************************** INSTALLATION. AMD 486. DATE-WRITTEN. SEPTEMBER 13 1994. DATE-COMPILED. SEPTEMBER 13 1994. SECURITY. NONE. ═══ 2. ENVIRONMENT DIVISION ═══ ENVIRONMENT DIVISION. ═══ 2.1. CONFIGURATION SECTION ═══ CONFIGURATION SECTION. SOURCE-COMPUTER. AMD-486 WITH DEBUGGING MODE. OBJECT-COMPUTER. AMD-486 MEMORY SIZE 384000 WORDS. SPECIAL-NAMES. ═══ 2.2. INPUT-OUTPUT SECTION ═══ INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT IN-FILE ASSIGN TO DISK. SELECT OUT-FILE ASSIGN TO DISK ORGANIZATION IS INDEXED ACCESS MODE IS RANDOM RECORD KEY IS OUT-KEY. ═══ 3. DATA DIVISION ═══ DATA DIVISION. ═══ 3.1. FILE SECTION ═══ FILE SECTION. ═══ 3.1.1. IN-FILE ═══ FD IN-FILE LABEL RECORDS ARE STANDARD BLOCK CONTAINS 0 RECORDS VALUE OF FILE-ID IS 'CUST.DAT' DATA RECORD IS IN-FILE-RECORD . 01 IN-FILE-RECORD . 03 NAME . 05 FIRST-NAME PIC X(15). 05 MI PIC X(1). 05 LAST-NAME PIC X(15). 03 ADDRESS . 05 STREET-ADDRESS PIC X(20). 05 CITY PIC X(15). 05 STATE PIC X(02). 05 ZIP PIC X(09). 03 COMPUSERVE-ID PIC X(09). 03 PHONE . 05 AREA-CODE PIC X(03). 05 PREFIX PIC X(03). 05 SUFFIX PIC X(04). ═══ 3.1.2. OUT-FILE ═══ FD OUT-FILE LABEL RECORDS ARE STANDARD VALUE OF FILE-ID IS 'OUTFILE.DAT' DATA RECORD IS OUT-FILE-RECORD . 01 OUT-FILE-RECORD . 03 OUT-KEY PIC X(31). 03 FILLER PIC X(65). ═══ 3.2. WORKING-STORAGE SECTION ═══ WORKING-STORAGE SECTION. ═══ 3.2.1. IN-FILE-EOF-FLAG ═══ 01 IN-FILE-EOF-FLAG PIC X(01) VALUE 'N'. 88 IN-FILE-EOF VALUE 'Y'. ═══ 4. PROCEDURE DIVISION ═══ PROCEDURE DIVISION. ═══ 4.1. M1-MAINLINE ═══ M1-MAINLINE SECTION. *********************************************** * M 1 - M A I N L I N E * *********************************************** ═══ 4.1.1. MAINLINE ═══ MAINLINE . *********************************************** * M A I N L I N E * *********************************************** * MAIN DRIVER FOR THE PROGRAM * *********************************************** PERFORM OPEN-FILES . PERFORM INFILE-GET-FIRST . IF NOT IN-FILE-EOF PERFORM INFILE-PROCESS-GET-NEXT UNTIL IN-FILE-EOF . PERFORM CLOSE-FILES . STOP RUN. ═══ 4.1.2. OPEN-FILES ═══ OPEN-FILES . *********************************************** * O P E N F I L E S * *********************************************** * OPENS FILES USED BY HYPRDEMO * *********************************************** OPEN INPUT IN-FILE . OPEN OUTPUT OUT-FILE . ═══ 4.1.3. INFILE-GET-FIRST ═══ INFILE-GET-FIRST . *********************************************** * I N F I L E - G E T - F I R S T * *********************************************** * GETS THE FIRST INPUT FILE RECORD * *********************************************** READ IN-FILE AT END MOVE 'Y' TO IN-FILE-EOF-FLAG . ═══ 4.1.4. INFILE-PROCESS-GET-NEXT ═══ INFILE-PROCESS-GET-NEXT . *********************************************** * I N F I L E - G E T - N E X T * *********************************************** * GETS THE NEXT INPUT FILE RECORD * *********************************************** PERFORM PROCESS-IN-FILE READ IN-FILE AT END MOVE 'Y' TO IN-FILE-EOF-FLAG . ═══ 4.1.5. PROCESS-IN-FILE ═══ PROCESS-IN-FILE . *********************************************** * P R O C E S S - I N - F I L E - R E C O R D * *********************************************** * PRINTS THE CURRENT IN FILE RECORD TO THE * * CONSOLE AND WRITES IT TO THE OUTPUT FILE * *********************************************** DISPLAY ' ' DISPLAY '=======MAILING LABEL=======' DISPLAY FIRST-NAME MI LAST-NAME DISPLAY STREET-ADDRESS CITY STATE ZIP DISPLAY ' ' MOVE IN-FILE-RECORD TO OUT-FILE-RECORD . WRITE OUT-FILE-RECORD . ═══ 4.1.6. CLOSE-FILES ═══ CLOSE-FILES . *********************************************** * C L O S E F I L E S * *********************************************** * CLOSES FILES USED BY HYPRDEMO * *********************************************** CLOSE IN-FILE . CLOSE OUT-FILE . ═══ ═══ M1-MAINLINE MAINLINE OPEN-FILES INFILE-GET-FIRST INFILE-PROCESS-GET-NEXT PROCESS-IN-FILE CLOSE-FILES OPEN-FILES INFILE-GET-FIRST INFILE-PROCESS-GET-NEXT PROCESS-IN-FILE PROCESS-IN-FILE CLOSE-FILES ═══ ═══ MAINLINE OPEN-FILES INFILE-GET-FIRST INFILE-PROCESS-GET-NEXT PROCESS-IN-FILE CLOSE-FILES ═══ ═══ OPEN-FILES ═══ ═══ INFILE-GET-FIRST ═══ ═══ INFILE-PROCESS-GET-NEXT PROCESS-IN-FILE ═══ ═══ PROCESS-IN-FILE ═══ ═══ CLOSE-FILES ═══ ═══ How many times have you been in this situation? There is a foot-thick program listing sitting ominously on your desk, post-it notes sticking out everywhere. Within the next 24 hours (and you'll probably use most of them) you have to: 1) Figure out why it isn't working correctly. 2) Come up with a solution. 3) Verify the solution with a user in order to ensure that it will meet their needs. 4) Implement and test the fix. All of the time-consuming tasks listed above and more can be accomplished more quickly and effectively by quickly getting to the heart of the code. CASEy COBOL HyperCode is a unique utility program that transforms any COBOL program into a HyperText-linked OS/2 information file. This provides systems development organizations with a number of benefits, it: o Dramatically reduces the amount of time required in the discovery phase of system maintenance. o Brings new programmers up to speed quickly by allowing them to view examples of standardized code. The popup definitions can be used to clarify obscure programming commands and/or conventions. o Provides programmers with the ability to more quickly (and thoroughly) desk check programs before intensive testing. o Utilizes an organization's data dictionary to create a popup definition (in the HyperCode file) for each program variable or command. o Acquaints systems professionals with the advantages of using the PC as an analysis tool. This can open the door to utilizing many of the exceedingly powerful applications including PC compilers, CASE tools and client-server database applications. HyperCode is a small, but potentially very useful step in this direction. ═══ ═══ This record represents customer records downloaded from a BBS. ═══ ═══ This record represents the customer records written to a indexed file for later use. ═══ ═══ The full name of the customer. ═══ ═══ The first name of the customer. ═══ ═══ The middle initial of the customer. ═══ ═══ The last name of the customer. ═══ ═══ The full address of the customer. ═══ ═══ The street address of the customer. ═══ ═══ The city of residence for the customer. ═══ ═══ The state of residence for the customer. ═══ ═══ The ZIP code of the customer. ═══ ═══ The Compuserve ID for the customer. ═══ ═══ The customer's full phone number. ═══ ═══ The customer's area code. ═══ ═══ The customer's phone prefix. ═══ ═══ The customer's phone suffix. ═══ ═══ The editor icon starts an editor window, bringing up the appropriate source file with the cursor positioned at the start of the current section. Because the path to the source code file is hard-coded by HyperCode at run-time, this demonstration file does not start the editor.