Presentation is loading. Please wait.

Presentation is loading. Please wait.

CICS-Prg1 Terminal Handling CURSOR Positioning (in SEND MAP) IC option in DFHMDF Macro (ATTRB Parm)  If more than one – LAST position is used. DIRECT.

Similar presentations


Presentation on theme: "CICS-Prg1 Terminal Handling CURSOR Positioning (in SEND MAP) IC option in DFHMDF Macro (ATTRB Parm)  If more than one – LAST position is used. DIRECT."— Presentation transcript:

1 CICS-Prg1 Terminal Handling CURSOR Positioning (in SEND MAP) IC option in DFHMDF Macro (ATTRB Parm)  If more than one – LAST position is used. DIRECT Cursor Positioning  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!)

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

3 CICS-Prg3 Terminal Handling (More yet) Determining the position of CURSOR when the user types an AID key. 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

4 CICS-Prg4 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’!

5 CICS-Prg5 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’!

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

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

8 CICS-Prg8 Misc CICS Commands HANDLE AID Options: PA1-PA3Program Attention Keys PF1-PF24Program Function Keys ENTERThe ENTER Key CLEARThe CLEAR Key ANYKEYAny key not Specified (Except the ENTER key)

9 CICS-Prg9 Handle AID Example (Old) EXEC CICS HANDLE AIDPF3(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.

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

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

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

13 CICS-Prg13 HANDLE CONDITION Common CONDITIONS DUPRECRecord already exists MAPFAILNo data sent by user NOSPACENo space left in file NOTOPENData set not OPEN NOTFNDRecord not in file PGMIDERRProgram not in PPT ERRORALL conditions not coded

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

15 CICS-Prg15 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!

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

17 CICS-Prg17 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

18 CICS-Prg18 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

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

20 CICS-Prg20 EIB Useful Fields EIBCALENLength of COMMAREA EIBAIDCurrent AID Key pressed EIBCPOSNPosition of CURSOR EIBDATETask DATE (00YYDDD) EIBTIMETask Time (0HHMMSS) EIBTRNIDTransaction of Task EIBTRMIDTerminal ID of Task EIBRSRCERecently used Resource Name EIBDSRecently accessed Data Set

21 CICS-Prg21 DEBUGGING EIB FIELDS EIBFNLast CICS Command EIBRESPCompletion Status EIBRESP2More Completion Status EIBRCODEResponse Code (OLD) EIBRSRCERecent Resource Name MAPMap Name PRG CTLProgram Name FILE CTLData Set Name

22 CICS-Prg22 Access to Heavy Stuff CWACommon Work Area Installation defined (Sometimes handy) CSACommon System Area TWATransaction Work Area TCTUATerminal Control Table User Area Must establish Addressability if needed

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

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


Download ppt "CICS-Prg1 Terminal Handling CURSOR Positioning (in SEND MAP) IC option in DFHMDF Macro (ATTRB Parm)  If more than one – LAST position is used. DIRECT."

Similar presentations


Ads by Google