Terminal Handling CURSOR Positioning in SEND MAP n

  • Slides: 24
Download presentation
Terminal Handling CURSOR Positioning (in SEND MAP) n IC option in DFHMDF Macro (ATTRB

Terminal Handling CURSOR Positioning (in SEND MAP) n IC option in DFHMDF Macro (ATTRB Parm) w If more than one – LAST position is used. n DIRECT Cursor Positioning w w w CURSOR(nnn) where nnn is position on screen Displacement from start of the screen ( Row – 1 ) * 80 + ( Column – 1 ) 0 is Row 1, Column 1 1919 is Row 24, Column 80 (24 by 80 Screen) Changes in screen require changes to program (Not used much - too complex!) CICS-Prg 1

Terminal Handling (More) CURSOR Positioning (in SEND MAP) n Symbolic Cursor Positioning (Preferred!) w

Terminal Handling (More) CURSOR Positioning (in SEND MAP) n Symbolic Cursor Positioning (Preferred!) w CURSOR – with no position parameter! w Specify the FIELD where the CURSOR goes w Place – 1 in the LENGTH Attribute of the field where the cursor is to be placed w ‘FIELD NAME’ with ‘L’ appended is LENGTH w If more than one – FIRST position is used. w BINARY HALFWORD - PIC S 9(04) COMP. CICS-Prg 2

Terminal Handling (More yet) Determining the position of CURSOR when the user types an

Terminal Handling (More yet) Determining the position of CURSOR when the user types an AID key. n n n EIBCPOSN – in EIB Block (binary halfword) READ only-Available before RECEIVE MAP Can be used to determine user selection instead of requiring user to enter character CICS-Prg 3

Attribute Modification Symbolic Map includes Attribute byte ‘Field Name’ with ‘A’ appended Cryptic ‘bit’

Attribute Modification Symbolic Map includes Attribute byte ‘Field Name’ with ‘A’ appended Cryptic ‘bit’ codes and names used Copy library supplied by IBM (Horrible) Most shops have their own copy book We do have ‘extended attributes’! CICS-Prg 4

Editing Input Data All data entered should be validated Required data must be present

Editing Input Data All data entered should be validated Required data must be present Numeric data needs to be ‘normalized’ Alpha data should not be spaces Meaningful error messages displayed Very tedious coding required! Do checking from ‘bottom to top’! CICS-Prg 5

Misc CICS Commands EXEC CICS SEND TEXT FROM(data-area) [ LENGTH(data-value) ] [ ERASE ]

Misc CICS Commands EXEC CICS SEND TEXT FROM(data-area) [ LENGTH(data-value) ] [ ERASE ] [ FREEKB] END-EXEC NOTE: No FREEKB user must hit RESET! CICS-Prg 6

Misc CICS Commands EXEC CICS HANDLE AID option(procedure name) … END-EXEC CICS-Prg 7

Misc CICS Commands EXEC CICS HANDLE AID option(procedure name) … END-EXEC CICS-Prg 7

Misc CICS Commands HANDLE AID Options: n n n PA 1 -PA 3 PF

Misc CICS Commands HANDLE AID Options: n n n PA 1 -PA 3 PF 1 -PF 24 ENTER CLEAR ANYKEY Program Attention Keys Program Function Keys The ENTER Key The CLEAR Key Any key not Specified (Except the ENTER key) CICS-Prg 8

Handle AID Example (Old) EXEC CICS HANDLE AID PF 3(900 -MENU) CLEAR(850 -CLEAR) ENTER(700

Handle AID Example (Old) EXEC CICS HANDLE AID PF 3(900 -MENU) CLEAR(850 -CLEAR) ENTER(700 -ENTER) ANYKEY(750 -ERROR) END-EXEC NOTE: HANDLE AID sets up RECEIVE MAP! Not executed when encountered! In OLD Progs. CICS-Prg 9

Error Processing There are over 70 CICS error Conditions Mercifully only a few are

Error Processing There are over 70 CICS error Conditions Mercifully only a few are handled TWO Methods of handling exceptions: n HANDLE CONDITION (Old Method) w Similar in function to HANDLE AID n RESPONSE Code checking w Allows cleaner program structure CICS-Prg 10

Strange Exception - MAPFAIL Condition n Raised by RECEIVE MAP with no data w

Strange Exception - MAPFAIL Condition n Raised by RECEIVE MAP with no data w User entered no data but pressed AID key w User pressed CLEAR key or PA key n Simplest to PREVENT it from occurring w Check EIBAID to see what key was pressed w Don’t issue RECEIVE MAP if PA or CLEAR hit w Include ‘DUMMY’ field with MDT set ON CICS-Prg 11

HANDLE CONDITION (Old!) EXEC CICS HANDLE CONDITION condition(procedure-name) … up to 16 per statement

HANDLE CONDITION (Old!) EXEC CICS HANDLE CONDITION condition(procedure-name) … up to 16 per statement END-EXEC CICS-Prg 12

HANDLE CONDITION Common CONDITIONS n n n n DUPREC MAPFAIL NOSPACE NOTOPEN NOTFND PGMIDERR

HANDLE CONDITION Common CONDITIONS n n n n DUPREC MAPFAIL NOSPACE NOTOPEN NOTFND PGMIDERR ERROR Record already exists No data sent by user No space left in file Data set not OPEN Record not in file Program not in PPT ALL conditions not coded CICS-Prg 13

HANDLE CONDITION Example EXEC CICS HANDLE CONDITION MAPFAIL(500 -NO-DATA) DUPREC(600 -DUPLICATE) NOTOPEN END-EXEC NOTE:

HANDLE CONDITION Example EXEC CICS HANDLE CONDITION MAPFAIL(500 -NO-DATA) DUPREC(600 -DUPLICATE) NOTOPEN END-EXEC NOTE: Condition by itself will nullify it! CICS-Prg 14

HANDLE CONDITION (Notes) Not an executable command Establishes paragraph to correct error Can issue

HANDLE CONDITION (Notes) Not an executable command Establishes paragraph to correct error Can issue multiple times Last one executed is in effect Causes ‘GO TO’ to paragraph named Done BEFORE CICS Command executed OLD method of coding – AVOID! CICS-Prg 15

RESPONSE CHECKING (NEW!) ADD ‘RESP’ option to CICS Command Define binary fullword PIC S

RESPONSE CHECKING (NEW!) ADD ‘RESP’ option to CICS Command Define binary fullword PIC S 9(8) COMP Name that field in each RESP option COPY of EIBRESP from EIBRESP 2 (RESP 2) also available n n Not many CICS Commands use it Seldom needed as RESP is usually enough CICS-Prg 16

USE General ERROR Handling Most good shops have a standard error handling method If

USE General ERROR Handling Most good shops have a standard error handling method If not, use sample linkage on Page 255 Sample program is on Page 257 Called whenever a condition is not handled in the program Displays error to user and terminates CICS-Prg 17

LINKAGE SECTION Used to access data left by previous execution of a program Data

LINKAGE SECTION Used to access data left by previous execution of a program Data should be moved to your W/S! Each execution starts with initial W/S Define COMMAREA in Working-Storage DEFINE DFHCOMMAREA in Linkage RETURN references Working-Storage CICS-Prg 18

Executive Interface Block EIB definition added by CICS Compiler In Linkage Section after DFHCOMMAREA

Executive Interface Block EIB definition added by CICS Compiler In Linkage Section after DFHCOMMAREA Contains several useful fields n EIBCALEN, EIBAID, EIBCPOSN, EIBDATE, EIBTIME, EIBTRNID, EIBTRMID, EIBRSRCE Most kept current by CICS (Page 258) You can update a few of them-EIBTRNID CICS-Prg 19

EIB Useful Fields EIBCALEN EIBAID EIBCPOSN EIBDATE EIBTIME EIBTRNID EIBTRMID EIBRSRCE EIBDS Length of

EIB Useful Fields EIBCALEN EIBAID EIBCPOSN EIBDATE EIBTIME EIBTRNID EIBTRMID EIBRSRCE EIBDS Length of COMMAREA Current AID Key pressed Position of CURSOR Task DATE (00 YYDDD) Task Time (0 HHMMSS) Transaction of Task Terminal ID of Task Recently used Resource Name Recently accessed Data Set CICS-Prg 20

DEBUGGING EIB FIELDS EIBFN EIBRESP 2 EIBRCODE EIBRSRCE n n n MAP PRG CTL

DEBUGGING EIB FIELDS EIBFN EIBRESP 2 EIBRCODE EIBRSRCE n n n MAP PRG CTL FILE CTL Last CICS Command Completion Status More Completion Status Response Code (OLD) Recent Resource Name Map Name Program Name Data Set Name CICS-Prg 21

Access to Heavy Stuff CWA n Common Work Area Installation defined (Sometimes handy) CSA

Access to Heavy Stuff CWA n Common Work Area Installation defined (Sometimes handy) CSA TWA TCTUA Common System Area Transaction Work Area Terminal Control Table User Area Must establish Addressability if needed CICS-Prg 22

Infrequently Needed Stuff EXEC CICS ADDRESS CWA(pointer) [ CSA(pointer) ] [ TWA(pointer) ] [

Infrequently Needed Stuff EXEC CICS ADDRESS CWA(pointer) [ CSA(pointer) ] [ TWA(pointer) ] [ TCTUA(pointer) ] END-EXEC CICS-Prg 23

Infrequently Needed Stuff EXEC CICS ADDRESS CWA(ADDRESS OF CWA) END-EXEC NOTE: Holdovers from MACRO-Level

Infrequently Needed Stuff EXEC CICS ADDRESS CWA(ADDRESS OF CWA) END-EXEC NOTE: Holdovers from MACRO-Level CICS Seldom needed any more! CICS-Prg 24