CICS
IBMs Customer Information Control System
CICS Programming Languages
Assembler COBOL PL/I Rexx C/C++ JAVA
Common types of on-line systems:
Menu Inquiry Data entry
On-line system considerations:
Performance File integrity Security Ease of use. Data integrity
Program Design
Critical! Can save hours (days!) PSEUDO-CONVERSATIONAL (different!) Event Driven - Major Functions
Pseudo-Conversational
An on-line program that actually ended while appearing to wait for a response. Single-user systems are conversational System waits for operator to enter data Single user system - nothing else to do Multi-user system cant waste the time 3270 screen handles operator activity
Pseudo-Conversational
Conversational program remains in storage during entire interaction. Pseudo-conversational program only in storage for a few seconds each action. Many more users can be processed Storage used more efficiently Minor complication to programs!
Pseudo-Conversational
Terminal handles operator entry Attention Key signals CICS screen ready
Enter, PF, PA, or Clear Key - (Event)
CICS reloads program (Virtual Storage) Program start at BEGINNING every time You must keep up with where user is User unaware that program restarted
PSEUDOCONVERSATIONAL PROGRAMMING:
WORKING-STORAGE
COMMON AREA
Program COMMON AREA
WORKING-STORAGE
CICS Table Entries
PCT = Program Control Table
TRANS-ID assigned to Program
PPT = Processing Program Table (2)
COBOL Program Mapset - Assembler Program
FCT = File Control Table
FILE(s) used by Program
Usually done by Systems Programmer
CICS Service Diagram
VSAM File Control CICS Application Programming Interface OS/390
DB2
IMS
SQL
DL/I
Terminal Control
Application Program
Basic Mapping Support
Maps
(VTAM,SNA,TCP/IP)
Terminal User
CICS Program Invocation
User Enters TRANS-ID CICS finds TRANS-ID in PCT to get program name CICS finds program name in PPT
CICS loads program into memory/ starts program
CICS runs program in address space
TRANS-ID = Transaction Identifier PCT = Program Control Table PPT= Processing Program Table
CICS Example - Screen 1
CICS Example - Screen 2
CICS Example - Screen 3
CICS Example - Screen 4
Creating a BMS MAPSET
3270 is FIELD oriented display Screen divided into user defined fields Each field has CHARACTERISTICS Determined by ATTRIBUTE BYTES (First character of each field!) Displayed as a space, but NOT available
Create the BMS Mapset
Defines the MAP(s) used by program MAP provides for screen formatting MAPSET is group of screens (1 or more) Normally only one MAP per MAPSET Only three macros used to create MAP Usually a Screen Generator is used
CICS Screen
Basic Mapping Support (BMS) or a Screen painter used to develop BMS uses assembler macros to define screen layout(s)
DFH = DFHMSD = DFHMDI map) DFHMDF = field) Always means CICS mapset descriptor (one per mapset) = map descriptor initiator (one per map descriptor field (one for each map
Define a Mapset
To define the mapset.
name DFHSMD TYPE=(type of mapset), MODE=how map is used, CTRL=FREEKB, LANG=language, TIOAPFX=YES, STORAGE = AUTO
To end a mapset definition
DFHSMD TYPE=FINAL
Example Mapset Definition
MENU013 DFHMSD TYPE=&SYSPARM, MODE=INOUT, TERM=ALL, LANG=COBOL, TIOAPFX=YES, CTRL=FREEKB, BASE=MAPS Maps and field definitions go here DFHMSD TYPE=FINAL END
Define a Map
MENU013 DFHMDI SIZE=(24,80), LINE=1, COLUMN=1
Define Fields
DFHMDF POS=(7,10),LENGTH=10,INITIAL='LAST NAME:', ATTRB=ASKIP LNAME DFHMDF POS=(7,21),LENGTH=20,ATTRB=(UNPROT,IC)
MESSGE DFHMDF POS=(5,10),LENGTH=64,ATTRB=(PROT)
ATTRB Parameter
BRT NORM DRK PROT UNPROT IC FSET High intensity display Normal intensity Not displayed (Hidden) Protected no data keyed Data may be keyed in Initial cursor position MDT set ON for field
Protection Attribute
Protected user cant key data in field Unprotected user allowed to key data Auto-Skip cursor skips to next field
Used to mark end of data entry field Cursor automatically moves to next field
Intensity Attribute
Normal shown normal intensity Bright shown in high intensity No-display not shown (background)
Used for password entry Also used to hide data on screen
Coding a BMS Mapset
Only need two Assembler commands
PRINT NOGEN
DFHMSD Map Set Definition DFHMDI Map Definition DFHMDF Field (Attribute byte) Definition DFHMDI Map Definition DFHMDF Field (Attribute byte) Definition
END
More terminology
PHYSICAL MAP load module
Result of Assembly Contains table of screen locations of data Also contains attributes of each field
SYMBOLIC MAP Copy library member
Result of Assembly Usually used in COBOL program You can create your own if careful!
The Symbolic Map
Copy member created by Assembly Use COPY statement in COBOL Maximum of 7 character field names MAPGEN adds the 8th (last) character Fine for AssemblerMarginal in COBOL You can code your own if careful!
Symbolic Map Suffix List
I The INPUT data field O The OUTPUT data field (Same loc I) L Binary Halfword-S9(4) COMP that contains data returned in input field F Char w/80 if field was cleared A Char w/attrb for output (Same loc F) C/H Used for Color and/or Highlighting
Sample CICS Scenario
Transaction ID Entered Looked up in PCT - Program loaded Program displays initial map and ends User enters data and hits Enter key Program reloaded
Receives data from screen Processes data Sends response back to screen Returns to CICS
CICS Input/Output
CICS handles all I/O Treat screen as simple file (one record)
Can Read Screen RECEIVE MAP Can Write Screen SEND MAP
Can Return to CICS with ID of Program to execute next time user keys AID key Return without TRANS-ID, Exits to CICS
Send A Map
* SEND MAP FIRST TIME IN. * IF EIBCALEN = 0 MOVE 'MENU013' TO MAP-NAME PERFORM SEND-MAP-MAPONLY PERFORM RETURN-TRANSID END-IF
SEND-MAP-MAPONLY.
EXEC CICS SEND MAP(MAP-NAME) MAPONLY ERASE NOHANDLE END-EXEC EVALUATE EIBRESP WHEN DFHRESP(NORMAL)
Receive a Map
* * * RECEIVE MAP EXEC CICS RECEIVE MAP(MAP-NAME) INTO(MAPS) NOHANDLE END-EXEC EVALUATE EIBRESP WHEN DFHRESP(NORMAL) CONTINUE WHEN DFHRESP(MAPFAIL)