SPI Tokens
Data Definition Language (DDL) Reference Manual — 426798-002
7- 12
TOKEN-CODE Statement
•
COBOL source code:
01 ASSN-TKN-MY-STATUS NATIVE-4 VALUE IS 184680549.
01 ASSN-TKN-STAT-REPLY NATIVE-4 VALUE IS 184680550.
The value of the token code is generated from the values specified for the token
data type in the referenced TOKEN-TYPE statement and for the token number in
the VALUE clause of the TOKEN-CODE statement
−
the two token codes differ only
in their token numbers. DDL performs an unsigned left-shift on each of these
values to generate the single COBOL NATIVE-4 value shown in the example.
•
TAL source code:
Literal ASSN^TKN^MY^STATUS = 11D '<<' 24 + 2D '<<' 16 +
101D;
Literal ASSN^TKN^STAT^REPLY = 11D '<<' 24 + 2D '<<' 16 +
102D;
The value of the pTAL or TAL representation of the token code is identical to the
value generated for COBOL source-code output from the same TOKEN-CODE
statement.
•
TACL source code:
?Section ASSN^TKN^MY^STATUS Struct
BEGIN
INT2 TOKEN^CODE VALUE 184680549;
END
?Section ASSN^TKN^STAT^REPLY Struct
BEGIN
INT2 TOKEN^CODE VALUE 184680550;
END
The generated value is identical to the value of a pTAL or TAL literal or a COBOL
data item generated from the same TOKEN-CODE statement.
•
C source code:
#pragma section assn_tkn_my_status
#define ASSN_TKN_MY_STATUS 184680549LU
#pragma section assn_tkn_stat_reply
#define ASSN_TKN_STAT_REPLY 184680550LU
The value of the TOKEN-CODE statement generated for C is the same as that
generated for COBOL, pTAL, TAL, or TACL.
•
Pascal source code:
?Section ASSN_TKN_MY_STATUS
CONST ASSN_TKN_MY_STATUS = 184680549;