IBM Support

Version 8 syntax error due to the wrong CCSID

Question & Answer


Question

In Version 8, I am receiving a syntax error on the following lines of C code in SYSIN: #include EXEC SQL INCLUDE SQLCA; struct dsnMsg {short len; char txt[7][132];} dsnMsg = {7 * 132}; extern short dsntiar(struct sqlca *,struct dsnMsg *,int *); Error: DSNH007I E DSNHTOKR LINE 5 COL 35 ILLEGAL CHARACTER IGNORED: "I" ('AD'X) The same program compiles on Version 7 without error.

Cause

The precompile step is being run with a DECP with CCSID(500), but the C program contains square brackets in CCSID 1047 codepoints ('AD'x, 'BD'x):

OPTIONS SPECIFIED: HOST(CPP),SOURCE,XREF,MARGINS(1,80),STDSQL(NO)
OPTIONS USED - SPECIFIED OR DEFAULTED
    APOST                            
    APOSTSQL                
    ATTACH(TSO)                    
   
CCSID(500)      <---- defaulted from DECP 
    NOPADNTSTR    
    CONNECT(2)
    FLAG(I)    
    HOST(CPP)  
    FLOAT(S390)            
    LINECOUNT(60)  
    MARGINS(1,80)      
    NEWFUN(YES)
    ONEPASS  
    OPTIONS  
    PERIOD      
    SOURCE  
    STDSQL(NO)  
    SQL(DB2)
    XREF

struct dsnMsg {short len; char txt*7**132*;}  


In the line shown above, the *'s represent square brackets with hex representation 'AD'x and 'BD'x (CCSID 1047 codepoints).


The message, " DSNH007I E DSNHTOKR LINE 5 COL 35 ILLEGAL CHARACTER IGNORED: "I" ('AD'X)," explains that the character that cannot be recognized in CCSID 500 is the left square bracket in CCSID 1047.

Answer

Use the CCSID(1047) precompile option to precompile this program.

[{"Product":{"code":"SSEPEK","label":"Db2 for z\/OS"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Application Programming","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"8.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21170680