IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

select col1 into....syntax in db2-cobol program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Richa Jain

New User


Joined: 18 Mar 2008
Posts: 35
Location: Gurgaon

PostPosted: Thu Sep 04, 2008 6:09 pm
Reply with quote

The query in the db2-cobol program is as follows -

SELECT COL1
INTO T1-COL1:WS-COL1-IND
FROM T1

COL1 is defined as CHAR(1)
T1-COL1 is defined as PIC X(1) in cobol program
WS-COL1-IND is defined as PIC S9(4) COMP in working storage section

COL1 = '4'
T1-COL1 = 4
WS-COL1-IND = 0000

I do not understand why is WS-COL1-IND equal to 0000. Can anyone explain?

Thanks in advance
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Sep 04, 2008 7:00 pm
Reply with quote

Hello,

You'll find some information here.
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.apdv.embed.doc/doc/t0005636.htm

Thanks,
Arun
Back to top
View user's profile Send private message
Krishna Velamur

New User


Joined: 22 Aug 2008
Posts: 22
Location: Hyderabad

PostPosted: Fri Sep 05, 2008 11:48 am
Reply with quote

WS-COL1-IND is a null indicator. If the value of the column retrieved is null then WS-COL1-IND will be -1, or else it will be zero.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Fri Sep 05, 2008 12:07 pm
Reply with quote

Please try this
Code:
INTO :T1-COL1:WS-COL1-IND
Back to top
View user's profile Send private message
Richa Jain

New User


Joined: 18 Mar 2008
Posts: 35
Location: Gurgaon

PostPosted: Mon Sep 08, 2008 10:37 am
Reply with quote

Thanks.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top