While extracting data from a VARGRAPHIC (nullable) field into its respective HOST variable (with NULL IND VARIABLE defined), i am getting SQLCODE as 0 but SQLWARN0 and SQLWARN1 as 'W'
I have tried investigating the null indicator field for any clue, and found that it has the value +0100.
DB2 declaration:
CITY_NM VARGRAPHIC(40)
COBOL declaration:
10 CITY-NM.
49 CITY-NM-LN PIC S9(4) USAGE COMP.
49 CITY-NM-TX PIC N(40).
In the FETCH cursor, following is the variable which receives the data extracted. After extraction, this null indicator variable holds the value +0100....
:CITY-NM
:CITY-NM-NI
This is the capture of the table data
NAME TYPE LENGTH NULL VALUE
SBSCRB_CITY_NM VARCHAR 40 N ''
SQLCA information:
SQLCODE = +0000000000
SQLSTATE = '01004'
SQLERRML = +00000
SQLERRMC = ' '
SQLERRP = 'DSN '
SQLERRD
SUB(4) = -0000000001
SQLWARN0 = 'W'
SQLWARN1 = 'W'
SQLABC=+0000000136
I am unable to diagnose this issue for past 2 days. Could someone look into this and advise as to why we get a SQL Warning denoting a data truncation, when the table doesnt have any data for the impacted field.