Chapter Contents |
Previous |
Next |
The SAS/C CICS Command Translator |
cics.h
> header file at
the top of the output file.
#if 0 / #endif
.
/* before translation */ void readin(struct INPUT *record, char *key, short keylen) { . . . EXEC CICS READ DATASET("MASTER") INTO(record) LENGTH(sizeof(struct INPUT)) RIDFLD(key) KEYLENGTH(keylen); . . . }
During translation, the READ command is converted into the following C statements:
/* after translation */ #include <cics.h> void readin(struct INPUT *record, char *key, short keylen) { . . . #if 0 EXEC CICS READ DATASET("MASTER") INTO(record) LENGTH(sizeof(struct INPUT)) RIDFLD(key) KEYLENGTH(keylen); #endif { __ref void (*_ccp_exec_cics)(char *, const char *,void *,short,void *, short)= (__ref void (*)(char *,const char *, void *,short,void *,short)) _ccpexec;_ccp_exec_cics ("\x06\x02\xf8\x00\x09\x00\x00\x80\x00" "00000006", "MASTER" " ",record,sizeof(struct INPUT), key,keylen); } . . . }
First, the
cics.h
header file is included
at the top of the output file. Next, the original command remains in the
source file, but is surrounded with the
#if 0
/
#endif
.
CICS commands are then translated into the following sequence (assuming the
PROTO option is in effect):
_ccp_exec_cics
. (This pointer is assigned
a pointer to the EXEC command interface
function
_ccpexec
that is declared in
cics.h
.
This declaration generates a prototype. Because the translator is not able
to determine whether the types of the function arguments are correct, the
prototypes allow the compiler to check them.)
Taking Advantage of Prototypes |
The translator automatically
generates prototypes for CICS command
arguments. Prototype generation is useful because it helps determine whether
the argument types are correct. For example, this feature enables you to
catch mistakes such as specifying an
int
type variable instead
of a
short
.
EXEC CICS LOAD PROGRAM("FTOC");
After translation, the command appears as the following:
EXEC CICS LOAD PROGRAM("FTOC" " ");
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.