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: 2239
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 RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm


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