Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 2276
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 DB2 Program abending without giving a... rahulgarg14 DB2 3 Mon May 29, 2017 8:10 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us