home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
cobol
/
library
/
assist
/
detail1a.cbl
< prev
next >
Wrap
Text File
|
1993-12-08
|
13KB
|
303 lines
000010$set ans85 mf noosvs acceptrefresh
000020
000030 IDENTIFICATION DIVISION.
000040 PROGRAM-ID. DETAIL1.
000100********************** DETAIL1.CBL **********************************
000200** Copyright 1993 George F. Harris
000210**
000300** THIS PROGRAM PRESENTS DETAIL INFORMATION FOR BASIC FILE STATUS
000400* RETURN CODES USING THE FSDETAIL FILE.
000700*********************************************************************
000800 ENVIRONMENT DIVISION.
000900 CONFIGURATION SECTION.
001000**********************
001100* special names section CRT Status identifies exact usage of
001200* -cursor position a function key and th number of the
001300* - crt status key used.
001400**********************
001410 SPECIAL-NAMES.
001420 cursor is cursor-position
001430 crt status is key-status.
001431 FILE-CONTROL.
001442****************************
001443* INDEX FILE FOR BASIC
001444* STATUS CODES.
001445****************************
001446 SELECT DATAFILE ASSIGN TO "FSTAT2.DAT"
001447 ORGANIZATION IS INDEXED
001448 RECORD KEY IS FS-KEY
001449 ACCESS IS DYNAMIC
001450 FILE STATUS IS WS-STATUS.
001451 DATA DIVISION.
001452 FILE SECTION.
001453 FD DATAFILE
001454 DATA RECORD IS DATA-REC.
001455 01 DATA-REC.
001456 05 DETAILS PIC X(72) VALUE SPACES.
001457 05 pic x value spaces.
001458 05 FS-KEY PIC X(4).
001465 WORKING-STORAGE SECTION.
001468*01 TEMP-KEY PIC 9999 VALUE ZEROS.
001469*01 XS-TEMP-KEY PIC 9(5) VALUE ZEROS.
001470*01 TEMP-DETAILS.
001471* 05 TEMP-DETAIL PIC X(72) VALUE SPACES.
001472* 05 PIC X VALUE SPACES.
001473* 05 DETAIL-KEY PIC 9(4) VALUE ZEROS.
001474*01 R-KEY PIC 999 COMP.
001475*01 XS-STATUS-KEY PIC 9(5) VALUE ZEROS.
001477 01 WS-STATUS.
001478 05 FRST-STATUS PIC X.
001479 05 SEC-STATUS PIC X.
001480*01 XS-STATUS.
001481* 05 XS-STATUS-1 PIC X.
001482* 05 XS-SATATUS-2 PIC X.
001483 01 ERR-MSG-1 PIC X(15) VALUE SPACES.
001484 01 DETAIL-LINES.
001485 05 DETAIL-1 PIC X(72) VALUE SPACES.
001486 05 DETAIL-2 PIC X(72) VALUE SPACES.
001487 05 DETAIL-3 PIC X(72) VALUE SPACES.
001488 05 DETAIL-4 PIC X(72) VALUE SPACES.
001489 05 DETAIL-5 PIC X(72) VALUE SPACES.
001490 05 DETAIL-6 PIC X(72) VALUE SPACES.
001491 05 DETAIL-7 PIC X(72) VALUE SPACES.
001492 05 DETAIL-8 PIC X(72) VALUE SPACES.
001493 05 DETAIL-9 PIC X(72) VALUE SPACES.
001494 05 DETAIL-10 PIC X(72) VALUE SPACES.
001495 05 DETAIL-11 PIC X(72) VALUE SPACES.
001496 05 DETAIL-12 PIC X(72) VALUE SPACES.
001497 05 DETAIL-13 PIC X(72) VALUE SPACES.
001498 05 DETAIL-14 PIC X(72) VALUE SPACES.
001499 05 DETAIL-15 PIC X(72) VALUE SPACES.
001500 05 DETAIL-16 PIC X(72) VALUE SPACES.
001501 05 DETAIL-17 PIC X(72) VALUE SPACES.
001502 05 DETAIL-18 PIC X(72) VALUE SPACES.
001503 05 DETAIL-19 PIC X(72) VALUE SPACES.
001504 05 DETAIL-20 PIC X(72) VALUE SPACES.
001505 01 CHAIN-STATUS PIC X(4) VALUE SPACES.
001506 01 ERR-CD REDEFINES CHAIN-STATUS.
001507 05 CHAIN-1 PIC XX.
001508 05 CHAIN-2 PIC XX.
001510*************************
001511* cursor position fields allows positioning of cursor
001512*************************
001513 01 cursor-position.
001514 05 cursor-row pic 99 value zeros.
001520 05 cursor-column pic 99 value zeros.
001600*********************************************************************
001700** CRT STATUS KEYS
001800*********************************************************************
001900************************
002000* fields used to get a CALL X"AF" USING get-single-char
002100* single character with key-status
002200* call x"af" using Allows a single key from the keyboard
002300* command Holds action until key is pressed
002400************************
002500 01 Get-single-char pic 9(2) comp-x value 26.
002600 01 key-status.
002700 05 key-type pic x.
002800 05 key-code-1 pic 9(2) comp-x.
002900 05 key-code-2 pic 9(2) comp-x.
003000**********************************************************************
003100** The following fields are used with the call x"af" function to
003200** enable or disable various function and user keys
003300**********************************************************************
003400************************
003500* fields used to enable/
003600* disable adis messages, CALL X"AF" USING set-bit-pairs
003700* indicators and displays parameter-block
003800* using call x"af" command
003900************************
004000 01 set-bit-pairs pic 9(2) comp-x value 1.
004100 01 parameter-block.
004200 05 bit-pair-setting pic 9(2) comp-x.
004300 05 filler pic x value "2".
004400 05 bit-pair-number pic 9(2) comp-x.
004500 05 filler pic 9(2) comp-x value 1.
004600************************
004700* fields used to enable/
004800* disable function keys, CALL X"AF" USING set-bit-pairs-1
004900* using call x"af" command user-key-control
005000************************
005100 01 set-bit-pairs-1 pic 9(2) comp-x value 1.
005200 01 user-key-control.
005300 05 user-key-setting pic 9(2) comp-x.
005400 05 filler pic x value "1".
005500 05 first-user-key pic 9(2) comp-x.
005600 05 number-of-keys pic 9(2) comp-x.
005700**************************
005800* changes the key mapping CALL X"AF' USING set-map-byte
005900* from within the program ADIS-key-mapping
006000* using call x"af" using
006100* command
006200**************************
006300 01 set-map-byte pic 9(2) comp-x.
006400 01 adis-key-mapping.
006500 05 adis-mapping-byte pic 9(2) comp-x.
006600 05 adis-key-number pic 9(2) comp-x.
006700**********************************************************************
006800** SCREEN DISPLAY
006900**********************************************************************
007000 SCREEN SECTION.
007100 01 STATUS-SCREEN auto.
007110 05 LINE 2 COL 23 VALUE
007111 "THE STATUS CODE IN QUESTION IS" HIGHLIGHT.
007120 05 LINE 2 COL 54 PIC X(2) FROM CHAIN-1 HIGHLIGHT.
007200 05 LINE 4 COL 5 PIC X(72) FROM DETAIL-1.
007300 05 LINE 5 COL 5 PIC X(72) FROM DETAIL-2.
007400 05 LINE 6 COL 5 PIC X(72) FROM DETAIL-3.
007500 05 LINE 7 COL 5 PIC X(72) FROM DETAIL-4.
007600 05 LINE 8 COL 5 PIC X(72) FROM DETAIL-5.
007700 05 LINE 9 COL 5 PIC X(72) FROM DETAIL-6.
007800 05 LINE 10 COL 5 PIC X(72) FROM DETAIL-7.
007900 05 LINE 11 COL 5 PIC X(72) FROM DETAIL-8.
008000 05 LINE 12 COL 5 PIC X(72) FROM DETAIL-9.
008100 05 LINE 13 COL 5 PIC X(72) FROM DETAIL-10.
008200 05 LINE 14 COL 5 PIC X(72) FROM DETAIL-11.
008300 05 LINE 15 COL 5 PIC X(72) FROM DETAIL-12.
008400 05 LINE 16 COL 5 PIC X(72) FROM DETAIL-13.
008500 05 LINE 17 COL 5 PIC X(72) FROM DETAIL-14.
008600 05 LINE 18 COL 5 PIC X(72) FROM DETAIL-15.
008700 05 LINE 19 COL 5 PIC X(72) FROM DETAIL-16.
008800 05 LINE 20 COL 5 PIC X(72) FROM DETAIL-17.
008900 05 LINE 21 COL 5 PIC X(72) FROM DETAIL-18.
009000 05 LINE 22 COL 5 PIC X(72) FROM DETAIL-19.
009100 05 LINE 23 COL 5 PIC X(72) FROM DETAIL-20.
009110 05 LINE 25 COL 1 PIC X(15) FROM ERR-MSG-1 HIGHLIGHT.
009200 05 LINE 25 COL 20 VALUE "PRESS F1 TO RETURN" highlight.
009201 05 LINE 25 COL 50 VALUE "PRESS F10 TO QUIT" highlight.
009300 PROCEDURE DIVISION CHAINING CHAIN-STATUS.
009400 000-MAIN.
009410 PERFORM 050-OPEN.
009420 PERFORM 100-BASIC-STATUS.
009430 PERFORM 010-ENABLE.
009440 PERFORM 300-DISPLAY.
009510 050-OPEN.
009513 MOVE SPACES TO DETAIL-LINES.
009520 OPEN I-O DATAFILE.
009627 100-BASIC-STATUS.
009644 MOVE SPACES TO DETAIL-LINES.
009647 MOVE CHAIN-STATUS TO FS-KEY.
009649 START DATAFILE.
009650 READ DATAFILE.
009655 READ DATAFILE NEXT RECORD
009656 MOVE DETAILS TO DETAIL-1.
009660 READ DATAFILE NEXT RECORD
009700 MOVE DETAILS TO DETAIL-2.
009900 READ DATAFILE NEXT RECORD
010000 MOVE DETAILS TO DETAIL-3.
010200 READ DATAFILE NEXT RECORD
010300 MOVE DETAILS TO DETAIL-4 .
010500 READ DATAFILE NEXT RECORD
010600 MOVE DETAILS TO DETAIL-5.
010620 READ DATAFILE NEXT RECORD
010630 MOVE DETAILS TO DETAIL-6.
010650 READ DATAFILE NEXT RECORD
010660 MOVE DETAILS TO DETAIL-7.
010680 READ DATAFILE NEXT RECORD
010690 MOVE DETAILS TO DETAIL-8.
010692 READ DATAFILE NEXT RECORD
010693 MOVE DETAILS TO DETAIL-9.
010695 READ DATAFILE NEXT RECORD
010696 MOVE DETAILS TO DETAIL-10.
010699 READ DATAFILE NEXT RECORD
010700 MOVE DETAILS TO DETAIL-11.
010703 READ DATAFILE NEXT RECORD
010704 MOVE DETAILS TO DETAIL-12.
010707 READ DATAFILE NEXT RECORD
010708 MOVE DETAILS TO DETAIL-13.
010711 READ DATAFILE NEXT RECORD
010712 MOVE DETAILS TO DETAIL-14.
010715 READ DATAFILE NEXT RECORD
010716 MOVE DETAILS TO DETAIL-15.
010719 READ DATAFILE NEXT RECORD
010720 MOVE DETAILS TO DETAIL-16.
010723 READ DATAFILE NEXT RECORD
010724 MOVE DETAILS TO DETAIL-17.
010727 READ DATAFILE NEXT RECORD
010728 MOVE DETAILS TO DETAIL-18.
010731 READ DATAFILE NEXT RECORD
010732 MOVE DETAILS TO DETAIL-19.
010735 READ DATAFILE NEXT RECORD
010736 MOVE DETAILS TO DETAIL-20.
010799 010-ENABLE.
010800************************
010801*ENABLES FUNCITON KEY
010802*F-5
010803************************
010804 MOVE 1 TO USER-KEY-SETTING.
010805 MOVE 1 TO FIRST-USER-KEY.
010806 MOVE 10 TO NUMBER-OF-KEYS.
010807 CALL X"AF" USING SET-BIT-PAIRS-1
010808 USER-KEY-CONTROL.
010809 300-DISPLAY.
010810***********************
010811* sets color of screen
010812***********************
010813 DISPLAY " " AT 0101
010814 upon CRT
010815 erase
010816 with
010817 foreground-color is 7
010818 background-color is 1.
010819*************************
010820* displays main screen
010821*************************
010822 MOVE 1 TO CURSOR-ROW.
010823 MOVE 1 TO CURSOR-POSITION.
010826 DISPLAY STATUS-SCREEN.
010827**********************
010828* holds action until a
010829* keystroke
010830**********************
010831 CALL X"AF" USING GET-SINGLE-CHAR
010832 KEY-STATUS.
010833************************
010834* Sets up function keys
010835************************
010836 IF KEY-CODE-1 = 1
010837 CHAIN "ABEND2.EXE "
010841 ELSE
010842 IF KEY-CODE-1 = 2
010843 MOVE "NOT A VALID KEY" TO ERR-MSG-1
010844 PERFORM 300-DISPLAY
010845 ELSE
010846 IF KEY-CODE-1 = 3
010847 MOVE "NOT A VALID KEY" TO ERR-MSG-1
010848 PERFORM 300-DISPLAY
010849 ELSE
010850 IF KEY-CODE-1 = 4
010851 MOVE "NOT A VALID KEY" TO ERR-MSG-1
010852 PERFORM 300-DISPLAY
010853 ELSE
010854 IF KEY-CODE-1 = 5
010855 MOVE "NOT A VALID KEY" TO ERR-MSG-1
010856 PERFORM 300-DISPLAY
010859 ELSE
010860 IF KEY-CODE-1 = 6
010861 MOVE "NOT A VALID KEY" TO ERR-MSG-1
010862 PERFORM 300-DISPLAY
010863 ELSE
010864 IF KEY-CODE-1 = 7
010865 MOVE "NOT A VALID KEY" TO ERR-MSG-1
010866 PERFORM 300-DISPLAY
010867 ELSE
010868 IF KEY-CODE-1 = 8
010869 MOVE "NOT A VALID KEY" TO ERR-MSG-1
010870 PERFORM 300-DISPLAY
010871 ELSE
010872 IF KEY-CODE-1 = 9
010873 MOVE "NOT A VALID KEY" TO ERR-MSG-1
010874 PERFORM 300-DISPLAY
010875 ELSE
010876 IF KEY-CODE-1 = 10
010877 DISPLAY " " AT 0101
010878 upon CRT
010879 erase
010880 with
010881 foreground-color is 7
010882 background-color is 1
010883 PERFORM 999-ENDER.
010884 999-ENDER.
010890 CLOSE DATAFILE.
010900 STOP RUN.