Sei sulla pagina 1di 46

CICS - Part I

Basic Mapping Support (BMS)


CICS - Terminal Support
Terminal Devices
3270 data stream
BMS - Primary Functions
Device independence
Constant Information Handling
Access to data fields of the Screen
Terminal Paging
Message Routing
BMS - Sample Screen



ITEM-NO : XXXXXXXXXX

NAME : XXXXXXXXXXXXXXXXXXXXXXXX

QUANTITY : XXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
F1=Help F3=Exit F12=Cancel

Constant Field(protected)
Data Entry
Field(Unprotected)
Data Entry
Field(Unprotected)
Auto Skip Field
Stopper Field
Message Field
BMS - Field Types in Sample Layout
ITEM-NO : XXXXXXXXXX

NAME : XXXXXXXXXXXXXXXXXXXXXXXX

QUANTITY : XXXXXXXXXX


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
F1=Help F3=Exit F12=Cancel

Legend :
: Attribute byte : Autoskip Field : Stopper Field

Basic Mapping Support - Map Types
Physical map
Symbolic map
BMS - Map Set & Maps
Map set
Map
BMS - Map Definition Macros
DFHMSD - Defines a Mapset
DFHMDI - Defines a Map in a Mapset
DFHMDF - Defines a field in a Map
BMS - Map Definition Macros
DFHMSD Mapset Definition - Start
DFHMDI Map Definition - Map 1 Map 1
DFHMDF Field Definition in a Map - Field 1
DFHMDF Field Definition in a Map - Field 2


DFHMDI Map Definition - Map 2 Map 2
DFHMDF Field Definition in a Map - Field 1
DFHMDF Field Definition in a Map - Field 2


DFHMSD Mapset Definition - End
BMS Macros - Rules
Col. Col. Col. Col
1 9 16 72
+-------+---------+---------------------------------+
LABEL Op-Code Parameters separated continuation
by commas(parm1=..) char Col.72



Example

MAPSTNM DFHMSD TYPE=MAP,MODE=INOUT, X
LANG=COBOL,TIOAPFX=YES

BMS - DFHMSD Macro
setname DFHMSD TYPE={ &SYSPARM | DSECT | MAP },
MODE={ IN | OUT | INOUT },
LANG={ASM | COBOL | C | PLI },
TERM=terminal_type
STORAGE=AUTO,
TIOAPFX={ YES | NO },
CTRL=(ctrl1,ctrl2...)


Example.
col col col col
1---------------9-------------16----------------------------------------------72

ACCTSET DFHMSD TYPE=MAP,MODE=INOUT,LANG=COBOL, X
STORAGE=AUTO,TIOAPFX=YES
BMS - DFHMSD Macro (contd)
Extended Attributes

MAPATTS = (COLOR,HILIGHT)
DSATTS = (COLOR,HILIGHT)
EXTATT = {YES, NO, MAPONLY }

- To define color, high intensity, etc., as per CUA standards.

- Results in additional variables for each attribute in the symbolic
map.
BMS - DFHMDI Macro
mapname DFHMDI SIZE=(lines,columns),
LINE=line_number,
COLUMN=column_number,
JUSTIFY={ LEFT | RIGHT },
CTRL(ctrl1,ctrl2...)




Example.

MENUMAP DFHMDI SIZE(24,80),LINE =1,COLUMN =1, X
JUSTIFY=LEFT,CTRL(ALARM,FREEKB)


BMS - DFHMDF Macro
fldname DFHMDF POS=(line,column),
LENGTH=number,
INITIAL=text,
ATTRB=(attr1,attr2,attr3,attr4,attr5)
OCCURS=number,

Examples.

1. ITEM DFHMDF POS(13,16),LENGTH=6,ATTRIB(UNPROT,NUM)

2. DFHMDF POS(15,5),LENGTH=10,INITIAL=QUANTITY :, X
ATTRIB=ASKIP

BMS - DFHMDF Macro - Field Attributes
Field Attributes
Field Intensity : NORM / BRT / DRK
Field protection attribute : PROT / UNPROT / ASKIP
Field Characteristic : NUM
Initial Cursor Positioning : IC
Field Modification Indication : FSET
BMS - MDTs and their manipulation
MDT indicates whether a field is modified or not
MDT on will ensure that data is received into the
program

MDTs can be turned on by
Specifying the FSET attribute in the physical map
Setting the attribute byte to FSET in the symbolic map
Keying data into the field
BMS - MDT manipulation - FRSET
an attribute of DFHMSD macro

turns off all MDTs on the screen before sending a map

requires the physical map field attribute or the
symbolic override to control the MDT status
BMS - Ending a Mapset definition
Col. Col. Col. Col
1 9 16 72
+-------+---------+----------------------------+


DFHMSD TYPE=FINAL
END


Preparing Physical & Symbolic Maps
SYMBOLIC
MAP
COPY LIBRARY
MAP
DEFINITION
MACROS
ASSEMBLE
LINK EDIT
ASSEMBLE
PHYSICAL
MAP
LOAD LIBRARY
BMS - Symbolic Map Contents
Two 01-level items generated based on map name
01-level Item names suffixed with I or O for Input &
Output respectively
Additional level items defined for
Field for Length
Field for Attribute
Field for Modified Data Indication
Field for Input data
Field for Output Data.
01-level Item for Output REDEFINES Input area.
BMS - Sample Map Layout
NAME : ---------------------

ITEM-NO : ----------

QUANTITY : ----------


8 19 49
8
29
10
12
COL
ROW
BMS - Code for the Sample Layout
MAPSETS DFHMSD TYPE=&SYSPARM,MODE=INOUT,TERM=ALL, X
LANG=COBOL,TIOAPFX=YES,STORAGE=AUTO
MAPSMP DFHMDI SIZE(24,80),LINE=1,COLUMN=1
DFHMDF POS(8,7),LENGTH=10,INITIAL=NAME :, X
ATTRIB=ASKIP
NAME DFHMDF POS(8,18),LENGTH=20,ATTRIB(UNPROT,IC)
DFHMDF POS(8,40),LENGTH=1,ATTRIB=PROT
DFHMDF POS(10,7),LENGTH=10,INITIAL=ITEM NO :, X
ATTRIB=ASKIP
ITEM DFHMDF POS(10,18),LENGTH=6,ATTRIB=NUM)
DFHMDF POS(10,25),LENGTH=1,ATTRIB=ASKIP
DFHMDF POS(12,7),LENGTH=10,INITIAL=QUANTITY :, X
ATTRIB=ASKIP
QTY DFHMDF POS(12,18),LENGTH=6,ATTRIB=NUM
DFHMDF POS(12,25),LENGTH=1,ATTRIB=PROT

DFHMSD TYPE=FINAL
END
BMS - Symbolic Map for Sample Layout
01 MAPSMPI
02 FILLER X(12).
02 NAMEL S9(4) COMP.
02 NAMEF PIC X
02 FILLER REDEFINES NAMEF.
03 NAMEA PIC X.
02 NAMEI PIC X(20).
02 ITEML S9(4) COMP.
02 ITEMF PIC X
02 FILLER REDEFINES ITEMF.
03 ITEMA PIC X.
02 ITEMI PIC X(06).
02 QTYL S9(4) COMP.
02 QTYF PIC X
02 FILLER REDEFINES QTYF.
03 QTYA PIC X.
02 QTYI PIC X(06).
01 MAPSMPO REDEFINES MAPSMPI.
02 FILLER PIC X(12).
02 FILLER PIC X(3).
02 NAMEO PIC X(20).
02 FILLER PIC X(3).
02 ITEMO PIC X(06).
02 FILLER PIC X(3).
02 QTYO PIC X(06).

BMS - I/O operations
BMS COMMANDS FOR I/O OPERATIONS
SEND MAP
RECEIVE MAP
SEND CONTROL
SEND TEXT
SEND PAGE
BMS - SEND MAP command
EXEC CICS SEND
MAP (map_name)
MAPSET(mapset_name)
[FROM(data-area)]
[CURSOR(data-value)]
[ERASE|ERASEUP]
[DATA|MAP ONLY]
[ALARM]
END-EXEC
Data to be prepared before
SENDing the MAP :
Field Length : fieldname +L
Field Attribute : fieldname +A
Field Content: fieldname +O
BMS - Cursor Positioning
Cursor positioning required for positioning the cursor
In the first data entry field during data entry
In the first field resulting in data entry error
Cursor Positioning Techniques :
Initial cursor positioning
Direct cursor positioning
Symbolic cursor positioning
BMS - Changing Attributes
Need for changing Field attributes
Highlighting fields in error
Protecting fields during deletion
IBM Supplied copy library DFHBMSCA contains all
possible attribute combinations
Can be copied into the application program
BMS - SEND MAP command (Contd.)
SENDING MAP WITH NEITHER MAPONLY OR DATA ONLY
EXEC CICS SEND MAP(MAPSMP)
MAPSET(MAPSETS)
END EXEC.
SYMBOLIC MAP
PHYSICAL MAP
OUTPUT DATA STREAM
BMS - SEND MAP command(Contd.)
EXEC CICS SEND MAP(MAPSMP)
MAPSET(MAPSETS)
MAPONLY
END-EXEC.
EXEC CICS SEND MAP(MAPSMP)
MAPSET(MAPSETS)
DATAONLY
END-EXEC.
PHYSICAL MAP
OUTPUT DATA STREAM
SYMBOLIC MAP
OUTPUT DATA STREAM
BMS - RECEIVE MAP command
EXEC CICS RECEIVE
MAP(map_name)
MAPSET(mapset_name)
[INTO (data-area)]
ASIS
END-EXEC.
THE RECEIVE MAP COMMAND
RECEIVES DATA FROM THE
TERMINAL. THE SYMBOLIC MAP
WILL CONTAIN THE DATA.
DATA IN THE SYMBOLIC MAP

fieldname+L Contain the length of the input
data.
fieldname+F Flag field- Set to x80 or X82
if the field is modified, but
cleared.
fieldname+I Contains the input data. Filled
with x00 if no data is entered.

BMS - Detecting Cursor Position


Direct Cursor Position
Cursor Positioning Techniques
Symbolic cursor positioning
BMS - SEND/RECEIVE - Example
SEND MAP (MAPSMP)
MAPSET(MAPSETS)
MAPONLY


RECEIVE MAP (MAPSMP)
MAPSET(MAPSETS)


NAME :

ITEM-NO :

QUANTITY :
NAME : BOLT

ITEM-NO : 0023

QUANTITY : 5000
BMS - AIDKEY
WORKING STORAGE SECTION.
COPY DFHAID.

PROCEDURE DIVISION.
EXEC CICS RECEIVE MAP(MAPSMP) MAPSET(MAPSETS) END-EXEC

EVALUATE TRUE
W HEN EIBAID = DFHPF12
EXEC CICS RETURN END-EXEC
W HEN EIBAID = DFHENTER
PERFORM 1000-PROCESS-DATA
THRU 1000-PROCESS-DATA-EXIT
W HEN EIBAID = OTHER
MOVE Invalid Key Pressed TO MESSAGEO
END-EVALUATE.
Copybook containing the
definitions for AID keys
BMS - Summary
Primary functions of BMS
Screen classification
Physical and Symbolic maps
Mapsets, Maps and Fields; and their macros
Attributes of BMS macros
Map assembly
Symbolic map contents
A sample map and its Symbolic map
BMS I/O operations - SEND and RECEIVE Maps
...... contd
BMS - Summary (contd)
SEND map command
Cursor positioning
Changing attributes using Symbolic override
MDT manipulation - FSET & FRSET
RECEIVE map
Program Control
LINK
XCTL
COMMAREA and DATA PASSING
RETURN
LOAD
RELEASE

LINK command is used to pass control from an application
program at one logical level to another application at the
next lower logical level.

The calling program expects control to be returned to it.

Data can be passed to the called program through a special
communication area called COMMAREA.

The XCTL command is also do the same but it does not
return control back to the calling program.
LINK COMMAND
Logical Levels
CICS Sub System
LEVEL 0
LEVEL 1
LEVEL 2
Program A
XCTL Pgm B
LINK C

RETURN
Program C
RETURN

Program B
RETURN
EXEC CICS XCTL
PROGRAM(name)
COMMAREA(data-name)
LENGTH(data-value)
END-EXEC.
EXEC CICS LINK
PROGRAM(name)
COMMAREA(data-name)
LENGTH(data-value)
END-EXEC.
FORMAT OF LINK and XCTL COMMANDS
EXAMPLE:
WORKING-STORAGE SECTION.
01 WS-COMMAREA.
05 WS-COM-FIELD1 PIC X(50).
05 WS-COM-FIELD1 PIC X(50).
:
EXEC CICS XCTL
PROGRAM (TESTPGM)
COMMAREA(WS-COMMAREA)
LENGTH(WS-CALEN)
END-EXEC.

At the completion of the XCTL command, control will be passed to
the program TESTPGM with 100 bytes of data in WS-COMMAAREA.
Data can be passed to a called program using the
COMMAREA option of the LINK or XCTL command in a
calling program.
The called program may alter the data content of
COMMAREA and the changes will be available to the
calling program after the RETURN command is issued in
the called program .
COMMAREA must be defined in the W-S of the calling
program and in LINKAGE SECTION in called program.
Length must be specified in LENGTH parameter.
EIBCALEN determines whether COMMAREA was sent by
the calling program. If is greater than 0, COMMAREA was
sent. This should always be checked.

COMMAREA
EXAMPLE:
WORKING-STORAGE SECTION.
:
LINKAGE SECTION
01 DFHCOMMAREA.
05 LK-FIELD1 PIC X(50).
05 LK-FIELD2 PIC X(50).
PROCEDURE DIVISION.
IF EIBCALEN = 0 <= DFHCOMMAREA
GOTO ERR-RTN. will have the data of the
WS-COMMAREA of the
calling program.

The RETURN command is used to return control to the next higher
logical level, or CICS itself if this is the highest logical level. The format
of this command is as follows:
EXEC CICS RETURN
[TRANSID(name)]
[COMMAREA(data-area)]
[LENGTH(data-area) ]
END-EXEC.

If the TRANSID option is specified, the COMMAREA and LENGTH
option can be used to pass data to the next task. It is used to start
the task also.

RETURN
File Handling
Differences from COBOL
READ , READ FOR UPDATE
WRITE , REWRITE
UNLOCK , DELETE
STARTBR, READNEXT, READPREV, ENDBR, RESETBR

Unlike COBOL program files do not need to be opened or closed
in a CICS/VS application program.
Instead, CICS/VS has a list of all files it is allowed to access.
This list is called the File Control Table (FCT) and it is
maintained by System programmers.
When CICS/VS is started up, it goes through the FCT and opens
all the files. When it is closed down, CICS/VS closes all open
files.
In CICS/VS Program there is no need to code these two
SECTIONS.
FILE SECTION.
(where the FD statements are)
INPUT-OUTPUT SECTION.
(where the SELECT statements are)
DIFFERENCES FROM COBOL

Potrebbero piacerti anche