Chapter Contents |
Previous |
Next |
Terminal Control and Basic Mapping Support |
Commonly used macros include the following:
LANG=C
in the DFHMSD macro.
LANG=ASM
and convert the generated
DSECT to a C structure using the DSECT2C utility. For systems prior to CICS/ESA,
this technique is the only one available.
Using LANG=C |
If
you use symbolic maps generated by specifying
LANG=C
in the DFHMSD macro,
you must either specify the CBMSMAPS option to the CICS translator, or you
must use the FROM option of the SEND MAP command and the INTO option of the
RECEIVE MAP command. This example of code for BMS macros illustrates the
use of the LANG=C option:
M0 DFHMSD TYPE=MAP, LANG=C, MAPATTS=(COLOR,HILIGHT), EXTATT=YES, MODE=INOUT, CTRL=FREEKB, STORAGE=AUTO, TIOAPFX=YES M01 DFHMDI SIZE=(3,80),LINE=1 * DFHMDF ... * M02 DFHMDI SIZE=(3,80),LINE=4 * DFHMDF ... * DFHMSD TYPE=FINAL END
Here's an example of C code that uses the CBMSMAPS option and a symbolic map named "mapmm0":
#pragma options xopts(cbmsmaps) #include "mapm0.h" void main() { EXEC CICS SEND MAP("m01") MAPSET("m0") ERASE ; }
Here's what the equivalent command would look like if you did not specify the CBMSMAPS option:
#pragma options xopts(cbmsmaps) #include "mapm0.h" void main() { EXEC CICS SEND MAP("m01") MAPSET("m0") ERASE FROM (M01.MM01o) ; }
Using DSECT2C |
When using C as the application programming language,
create physical and logical maps for your mapset as described earlier. However,
in addition to these steps, you must also process the assembler-language output
listing for the symbolic assembly through the SAS/C utility,
DSECT2C. This utility creates a C structure that must be included into the SAS/C application
program source. It is recommended that you use
#include
, but you may also
in-line the C structure into the source.
The
-d
option for the DSECT2C utility facilitates BMS
map generation. By default, DSECT2C generates a structure definition only,
as shown in the following example:
struct XYZ { . . . };
When you specify the
-d
option, DSECT2C adds an identifier
to the definition, thereby declaring a variable of the structure type. The
identifier name is the structure tag in lowercase, as shown here:
struct XYZ { . . . } xyz;
SEND MAP("MAP1"); SEND MAP("MAP1") FROM(map1)...;
Therefore, a simple way to use BMS maps is to use
-d
with DSECT2C to generate the structure declaration in a header file. When
you include the header file (outside of any function), you are, in effect,
declaring an
extern
variable of the structure type. When you use SEND MAP or RECEIVE
MAP and allow the FROM/INTO options to default, the map will be sent from,
or received into, the external structure.
#define MAP1E 28
SEND MAP("MAP1"); SEND MAP("MAP1") FROM(map1) LENGTH(MAP1E);
Because the translator is aware of these changes, the
correct defaults are generated. For example, the command
SEND MAP("MAP#1");
causes
the translator to emit default values equivalent to the following:
SEND MAP("MAP#1") FROM(mapp_1) LENGTH(MAPP_1E);
Example of Using BMS with C |
Sample Map uses one of the maps specified for the sample application found in Examples. Map SASCAGA is created in mapset MAPSETA. The BMS definition for the map follows the display.
Sample Map
+OPERATOR INSTRUCTIONS --------------------- +OPERATOR INSTR - ENTER SMNU +FILE INQUIRY - ENTER SINQ AND NUMBER +FILE BROWSE - ENTER SBRW AND NUMBER +FILE ADD - ENTER SADD AND NUMBER +FILE UPDATE - ENTER SUPD AND NUMBER +PRESS CLEAR TO EXIT +ENTER TRANSACTION:+ +NUMBER+ +
The BMS map definition for this map is shown here:
TITLE 'FILEA - MAP FOR OPERATOR INSTRUCTIONS - SAS/C' MAPSETA DFHMSD TYPE=&SYSPARM,MODE=INOUT,CTRL=(FREEKB,FRSET), * LANG=ASM,TIOAPFX=YES,EXTATT=MAPONLY,COLOR=BLUE SASCAGA DFHMDI SIZE=(12,40) DFHMDF POS=(1,10),LENGTH=21,INITIAL='OPERATOR INSTRUCTIONS', * HILIGHT=UNDERLINE DFHMDF POS=(3,1),LENGTH=29,INITIAL='OPERATOR INSTR - ENTER* SMNU' DFHMDF POS=(4,1),LENGTH=38,INITIAL='FILE INQUIRY - ENTER* SINQ AND NUMBER' DFHMDF POS=(5,1),LENGTH=38,INITIAL='FILE BROWSE - ENTER* SBRW AND NUMBER' DFHMDF POS=(6,1),LENGTH=38,INITIAL='FILE ADD - ENTER* SADD AND NUMBER' DFHMDF POS=(7,1),LENGTH=38,INITIAL='FILE UPDATE - ENTER* SUPD AND NUMBER' MSG DFHMDF POS=(11,1),LENGTH=39,INITIAL='PRESS CLEAR TO EXIT' DFHMDF POS=(12,1),LENGTH=18,INITIAL='ENTER TRANSACTION:' DFHMDF POS=(12,20),LENGTH=4,ATTRB=IC,COLOR=GREEN, * HILIGHT=REVERSE DFHMDF POS=(12,25),LENGTH=6,INITIAL='NUMBER' KEY DFHMDF POS=(12,32),LENGTH=6,ATTRB=NUM,COLOR=GREEN, * HILIGHT=REVERSE DFHMDF POS=(12,39),LENGTH=1 DFHMSD TYPE=FINAL END
//SASCAMA JOB ...(your job accounting info )... //* //* EXECUTE THE IBM-SUPPLIED BMS CATALOGED PROCEDURE //* TO CREATE A LOGICAL MAP FOR USE BY CICS AND A //* SYMBOLIC MAP TO BE USED DURING DSECT2C PROCESSING //* // EXEC DFHMAPS, // DSCTLIB='your.symbolic.map.library ', // MAPNAME=SASCAGA //SYSUT1 DD DISP=SHR,DSNAME=SASC.SAMPLE(SASCAMA) INPUT MAP SOURCE //* //* EXECUTE THE SAS/C DSECT2C CATALOGED PROCEDURE //* USING THE PREVIOUSLY CREATED SYMBOLIC MAP TO CREATE //* A C STRUCTURE //* // EXEC DSECT2C,PARM.D2C='SASCAGA -D' //SYSLIB DD DISP=SHR,DSN=your.symbolic.map.library //SYSIN DD * SASCAGA DSECT COPY SASCAGA END //D2C.D2COUT DD DISP=SHR,DSN=your.c.header.library(SASCAGA)
To use this map, the program would specify the following:
#include <sascaga.h> main() { EXEC CICS SEND MAP("SASCAGA") MAPONLY ERASE; EXEC CICS RETURN; }
For additional information on this application, see the example in Examples.
BMS Input/Output Operations |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.