Page 1 of 1

HANDLE NULL IND FOR VARGRAPHIC nullable column(DB2) in COBOL

PostPosted: Fri Jun 24, 2016 8:25 pm
by hariharan_bk
Hi All,

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.

Re: HANDLE NULL IND FOR VARGRAPHIC nullable column(DB2) in C

PostPosted: Sat Jun 25, 2016 1:48 am
by NicC
How about posting the actual query?

Re: HANDLE NULL IND FOR VARGRAPHIC nullable column(DB2) in C

PostPosted: Sat Jun 25, 2016 12:32 pm
by hariharan_bk
The table has more than 100+ columns which are fetched, is that fine, if I post 5 fields before and after the impacted field... with the info of those fields?

Re: HANDLE NULL IND FOR VARGRAPHIC nullable column(DB2) in C

PostPosted: Sun Jun 26, 2016 3:18 pm
by NicC
TS failed to answer a question needed to try and resolve the issue. Topic locked.