Map field Definition PICIN and PICOUT in CICS ,IBM Mainframe
BMS (Basic Mapping Support) is a standard facility, to deal with the formatted screen operations. For making the application program device independent and format independent CICS provides Basic Mapping Support (BMS).
Screen defined through BMS is called a "MAP".
To build mapset defintion in CICS(Customer Information Control System) we use
- DFHMSD macro which defines a mapset,
- DFHMDI macro which defines a map within the mapset that is defined by
the DFHMSD macro and
- DFHMDF macro which defines a field within a map that is illustrated by the
DFHMDI macro.
Here we will talk about PICIN and PICOUT in DFHMDF while coding Basic Mapping Support in CICSMAP. We use many operands such as ATTRB, ASKIP, PROT, UNPROT, NUM, NORM, FSET in DFHMDF normally.
But suppose the
requirement is map variables involves many amount fields like
9(9)V99, 9(6)V99, 9(11) etc then we should use PICIN and PICOUT with DFHMDF. It reduces lot of effort of not to use temp variables in the code to move the input field
from the map to temp variable and then again from temp variable to output field in
map.
PICIN applies to the data field being input Eg. PICIN = ‘99999999’
PICOUT applies to the data field being output Eg. PICOUT = ‘ZZZZZ.99’ - If PICIN/PICOUT is not coded in the macro, the pic generated is always PIC X (length of field)
- By using PICIN/PICOUT BMS can be forced to generate the appropriate PIC.
- PICIN tells BMS how to move data into the `I' suffix field.
- PICOUT tells COBOL how to edit your data move to the `O' suffix field.
PICIN applies to the data field being input Eg. PICIN = ‘99999999’
Both occupy the same bytes of memory
Sample Example:-
Map declaration
-----------------------------------
AMT1 POS =(08,070),LENGTH=10, ATTB=(UNPROT,NUM,FSET),
PICIN='9(8)v99',PICOUT='ZZZZZZ9.99'
Map will generate the copybook like below
-----------------------------------------------------
02 AMT1L COMP PIC S9(4).
02 AMT1F PICTURE X.
02 FILLER REDEFINES RTAMT1F.
03 AMT1A PICTURE X.
02 AMT1I PICTURE 9(8)V99.
02 AMT1O PICTURE ZZZZZZ9.99
A very good article on CICS Tutorial
http://vatsmusic.blogspot.sg/2010/01/cics-tutorial.html
A very good article on Difference between PICIN and PICOUT
http://ibmmainframeforum.com/viewtopic.php?f=17&t=5735