000100 ID DIVISION. 00010000 000200 PROGRAM-ID. TRPGM75. 00020000 000300*AUTHOR. Kenneth W. Caldwell. 00030000 000400*INSTALLATION. Train-Right. 00040000 000500*DATE-WRITTEN. January 15, 2011. 00050000 000600*DATE-COMPILED. 00060000 000700* 00070000 000800*SECURITY. This program is for students of Train-Right 00080000 000900* courses ONLY!. 00090000 001000* 00100000 001100*REMARKS. This program displays a VSAM record. 00110000 001200* It is a Non-Conversational program. 00120000 001300* This program can execute as a 3270 or subprogram.00130000 001400* 00140000 001500 DATA DIVISION. 00150000 001600 WORKING-STORAGE SECTION. 00160000 001700 01. 00170000 001800 05 result. 00180000 001900 10 user-area. 00190000 002000 15 user-input. 00200000 002100 20 PIC X(5) VALUE SPACES. 00210000 002200 20 user-team PIC X(5) VALUE SPACES. 00220000 002300 20 user-num PIC X(2) VALUE SPACES. 00230000 002400 15 PIC X(68) VALUE SPACES. 00240000 002500 10 msg1 PIC X(80). 00250000 002600 COPY TRRECORD REPLACING ==01== BY ==10== 00260000 002700 ==05== BY ==15== 00270000 002800 ==10== BY ==20==. 00280000 002900 10 msg2 PIC X(80) VALUE 00290000 003000 'Change your choice and press ENTER to play again. Cle00300000 003100- 'ar screen to stop playing.'. 00310000 003200 10 msg3. 00320000 003300 15 PIC X(10) VALUE 'Facility: '. 00330000 003400 15 facility PIC X(4) VALUE SPACES. 00340000 003500 15 PIC X(8) VALUE ' Sysid: '. 00350000 003600 15 sysid PIC X(4). 00360000 003700 15 PIC X(13) VALUE ' Start Code: '.00370000 003800 15 start-code PIC X(2). 00380000 003900 15 PIC X(2) VALUE SPACES. 00390000 004000 15 PIC X(11) VALUE ' From Pgm: '. 00400000 004100 15 invoking-pgm PIC X(8). 00410000 004200 15 PIC X(9) VALUE ' To Pgm: '. 00420000 004300 15 return-pgm PIC X(8). 00430000 004400 00440000 004500 LINKAGE SECTION. 00450000 004600 01 dfhcommarea. 00460000 004700 COPY TRRECORD REPLACING ==01== BY ==05== 00470000 004800 ==05== BY ==10== 00480000 004900 ==10== BY ==15==. 00490000 005000 00500000 005100 PROCEDURE DIVISION. 00510000 005200 Main. 00520000 005300 EXEC CICS ASSIGN FACILITY(facility) 00530000 005400 SYSID(sysid) 00540000 005500 INVOKINGPROG(invoking-pgm) 00550000 005600 RETURNPROG(return-pgm) 00560000 005700 STARTCODE(start-code) 00570000 005800 END-EXEC. 00580000 005900 00590000 006000 Receive-Trans-Input. 00600000 006100 EXEC CICS IGNORE CONDITION LENGERR END-EXEC. 00610000 006200* Receive updates eibcposn. 00620000 006300 EXEC CICS RECEIVE INTO(user-input) 00630000 006400 MAXFLENGTH(LENGTH OF user-input) 00640000 006500 END-EXEC. 00650000 006600 00660000 006700 Process-Data. 00670000 006800 EXEC CICS HANDLE CONDITION NOTFND(No-Record) END-EXEC. 00680000 006900 00690000 007000 EVALUATE user-team ALSO user-num 00700000 007100 WHEN SPACES ALSO SPACES 00710000 007200 MOVE 'No key information entered. 1st record displayed.' 00720000 007300 TO msg1 00730000 007400 MOVE LOW-VALUES TO tr-key OF result 00740000 007500 EXEC CICS READ FILE('TRVSAM') INTO(tr-record OF result) 00750000 007600 RIDFLD(tr-key OF result) 00760000 007700 GTEQ 00770000 007800 END-EXEC 00780000 007900 WHEN NOT SPACES ALSO SPACES 00790000 008000 MOVE 'Teamid only entered. 1st record for team displayed.' 00800000 008100 TO msg1 00810000 008200 MOVE user-team TO tr-key-team OF result 00820000 008300 EXEC CICS READ FILE('TRVSAM') INTO(tr-record OF result) 00830000 008400 RIDFLD(tr-key OF result) 00840000 008500 KEYLENGTH(LENGTH OF tr-key-team OF result) 00850000 008600 GENERIC 00860000 008700 EQUAL 00870000 008800 END-EXEC 00880000 008900 WHEN OTHER 00890000 009000 MOVE 'Teamid and number entered. Exact match required.' 00900000 009100 TO msg1 00910000 009200 MOVE user-team TO tr-key-team OF result 00920000 009300 MOVE user-num TO tr-key-num OF result 00930000 009400 EXEC CICS READ FILE('TRVSAM') INTO(tr-record OF result) 00940000 009500 RIDFLD(tr-key OF result) 00950000 009600 EQUAL 00960000 009700 END-EXEC 00970000 009800 END-EVALUATE. 00980000 009900 00990000 010000 Send-Result. 01000000 010100 EXEC CICS SEND FROM(result) ERASE END-EXEC. 01010000 010200 01020000 010300 Process-Exit. 01030000 010400 IF invoking-pgm > SPACES 01040000 010500 THEN MOVE tr-record OF result TO tr-record OF dfhcommarea 01050000 010600 END-IF. 01060000 010700 01070000 010800 EXEC CICS RETURN END-EXEC. 01080000 010900* Dummy GOBACK. 01090000 011000 GOBACK. 01100000 011100 01110000 011200 No-Record. 01120000 011300 MOVE 'No record found with provided information.' TO msg1. 01130000 011400 MOVE SPACES TO tr-record OF result. 01140000 011500 GO TO Send-Result. 01150000