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



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

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

Postby hariharan_bk » Fri Jun 24, 2016 8:25 pm

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.
Many Thanks,
Harry
hariharan_bk
 
Posts: 73
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

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

Postby NicC » Sat Jun 25, 2016 1:48 am

How about posting the actual query?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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

Postby hariharan_bk » Sat Jun 25, 2016 12:32 pm

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?
Many Thanks,
Harry
hariharan_bk
 
Posts: 73
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

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

Postby NicC » Sun Jun 26, 2016 3:18 pm

TS failed to answer a question needed to try and resolve the issue. Topic locked.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post