cics-prg1 terminal handling cursor positioning (in send map) ic option in dfhmdf macro (attrb parm) ...

24
CICS-Prg 1 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!)

Upload: aleesha-burns

Post on 27-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 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

CICS-Prg 1

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!)

Page 2: 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

CICS-Prg 2

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.

Page 3: 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

CICS-Prg 3

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

Page 4: 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

CICS-Prg 4

Attribute Modification

Symbolic Map includes Attribute byte‘Field Name’ with ‘A’ appendedCryptic ‘bit’ codes and names usedCopy library supplied by IBM (Horrible)Most shops have their own copy bookWe do have ‘extended attributes’!

Page 5: 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

CICS-Prg 5

Editing Input Data

All data entered should be validatedRequired data must be presentNumeric data needs to be ‘normalized’Alpha data should not be spacesMeaningful error messages displayedVery tedious coding required!Do checking from ‘bottom to top’!

Page 6: 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

CICS-Prg 6

Misc CICS Commands

EXEC CICSSEND TEXT FROM(data-area)

[ LENGTH(data-value) ][ ERASE ][ FREEKB]

END-EXECNOTE: No FREEKB user must hit RESET!

Page 7: 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

CICS-Prg 7

Misc CICS Commands

EXEC CICSHANDLE AID

option(procedure name)…

END-EXEC

Page 8: 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

CICS-Prg 8

Misc CICS Commands

HANDLE AID Options: PA1-PA3 Program Attention Keys PF1-PF24 Program Function Keys ENTER The ENTER Key CLEAR The CLEAR Key ANYKEY Any key not Specified

(Except the ENTER key)

Page 9: 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

CICS-Prg 9

Handle AID Example (Old)

EXEC CICSHANDLE AID PF3(900-MENU)

CLEAR(850-CLEAR)ENTER(700-ENTER)ANYKEY(750-ERROR)

END-EXECNOTE: HANDLE AID sets up RECEIVE MAP!Not executed when encountered! In OLD

Progs.

Page 10: 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

CICS-Prg 10

Error Processing

There are over 70 CICS error ConditionsMercifully only a few are handledTWO Methods of handling exceptions: HANDLE CONDITION (Old Method)

Similar in function to HANDLE AID RESPONSE Code checking

Allows cleaner program structure

Page 11: 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

CICS-Prg 11

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

Page 12: 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

CICS-Prg 12

HANDLE CONDITION (Old!)

EXEC CICSHANDLE CONDITION

condition(procedure-name)condition(procedure-name)… up to 16 per statement

END-EXEC

Page 13: 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

CICS-Prg 13

HANDLE CONDITION

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

Page 14: 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

CICS-Prg 14

HANDLE CONDITION Example

EXEC CICSHANDLE CONDITION

MAPFAIL(500-NO-DATA)DUPREC(600-DUPLICATE)NOTOPEN

END-EXECNOTE: Condition by itself will nullify it!

Page 15: 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

CICS-Prg 15

HANDLE CONDITION (Notes)

Not an executable commandEstablishes paragraph to correct errorCan issue multiple timesLast one executed is in effectCauses ‘GO TO’ to paragraph namedDone BEFORE CICS Command executedOLD method of coding – AVOID!

Page 16: 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

CICS-Prg 16

RESPONSE CHECKING (NEW!)

ADD ‘RESP’ option to CICS CommandDefine binary fullword PIC S9(8) COMPName that field in each RESP optionCOPY of EIBRESP from EIB EIBRESP2 (RESP2) also available Not many CICS Commands use it Seldom needed as RESP is usually enough

Page 17: 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

CICS-Prg 17

USE General ERROR Handling

Most good shops have a standard error handling methodIf not, use sample linkage on Page 255Sample program is on Page 257Called whenever a condition is not handled in the programDisplays error to user and terminates

Page 18: 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

CICS-Prg 18

LINKAGE SECTION

Used to access data left by previous execution of a programData should be moved to your W/S!Each execution starts with initial W/SDefine COMMAREA in Working-StorageDEFINE DFHCOMMAREA in LinkageRETURN references Working-Storage

Page 19: 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

CICS-Prg 19

Executive Interface Block

EIB definition added by CICS CompilerIn Linkage Section after DFHCOMMAREAContains 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

Page 20: 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

CICS-Prg 20

EIB Useful FieldsEIBCALEN Length of COMMAREAEIBAID Current AID Key pressedEIBCPOSNPosition of CURSOREIBDATE Task DATE (00YYDDD)EIBTIME Task Time (0HHMMSS)EIBTRNID Transaction of TaskEIBTRMID Terminal ID of TaskEIBRSRCE Recently used Resource NameEIBDS Recently accessed Data Set

Page 21: 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

CICS-Prg 21

DEBUGGING EIB FIELDS

EIBFN Last CICS CommandEIBRESP Completion StatusEIBRESP2 More Completion StatusEIBRCODE Response Code (OLD)EIBRSRCE Recent Resource Name MAP Map Name PRG CTL Program Name FILE CTL Data Set Name

Page 22: 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

CICS-Prg 22

Access to Heavy Stuff

CWA Common Work Area Installation defined (Sometimes handy)

CSA Common System AreaTWA Transaction Work AreaTCTUA Terminal Control Table

User AreaMust establish Addressability if needed

Page 23: 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

CICS-Prg 23

Infrequently Needed Stuff

EXEC CICSADDRESS CWA(pointer)

[ CSA(pointer) ][ TWA(pointer) ][ TCTUA(pointer) ]

END-EXEC

Page 24: 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

CICS-Prg 24

Infrequently Needed Stuff

EXEC CICSADDRESS CWA(ADDRESS OF

CWA)END-EXEC

NOTE: Holdovers from MACRO-Level CICS

Seldom needed any more!