Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
select col1 into....syntax in db2-cobol program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: select col1 into....syntax in db2-cobol program
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: 2361
Location: @my desk

PostPosted: Thu Sep 04, 2008 7:00 pm    Post subject:
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    Post subject: Reply to: select col1 into....syntax in db2-cobol program
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help - DB2 Dynamic SQL Program e... NikhilGuptaGaya DB2 4 Sat Jun 23, 2018 1:58 pm
This topic is locked: you cannot edit posts or make replies. Issue in suppressing leading zeros &a... Vijay_Sirisha COBOL Programming 21 Thu Jun 07, 2018 8:01 pm
No new posts VBS to VB in COBOL and JCL srajendran2 COBOL Programming 12 Fri Jun 01, 2018 3:04 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts How to convert 2 bytes into single by... pkmurali DB2 6 Fri May 25, 2018 1:41 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us