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
 

 

Host variables in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 183
Location: Toronto, ON, Canada

PostPosted: Wed Jun 27, 2012 8:06 pm    Post subject: Host variables in COBOL
Reply with quote

If I have a variable structure
Code:
01 A.
05 B.
10 C.
15 D PIC X(10).

If D is not unique within the program I have to do
Code:
MOVE 'TEXT' TO D OF A


If I want to use D as a variable in an SQL fetch how do I code this?
Code:
FETCH my-cursor INTO :D OF A

I looked through the db2 manuals but couldn't find this.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1534
Location: Andromeda Galaxy

PostPosted: Wed Jun 27, 2012 8:10 pm    Post subject:
Reply with quote

May be Try ??

Code:
FETCH my-cursor INTO :A.D
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Wed Jun 27, 2012 8:23 pm    Post subject:
Reply with quote

Pandora-Box.. you were close..
It should be C.D

Jerry, please let us know if this satisfies your requirement.
I could find this link from IBM..
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Wed Jun 27, 2012 8:27 pm    Post subject:
Reply with quote

I tried
Code:
:A.D
Code:
:B.D
Code:
:C.D
. All of them worked... icon_smile.gif
Back to top
View user's profile Send private message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 183
Location: Toronto, ON, Canada

PostPosted: Wed Jun 27, 2012 8:32 pm    Post subject:
Reply with quote

Thanks all. Just curious - is it possible to do:
Code:
:A.B.C.D
?
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1534
Location: Andromeda Galaxy

PostPosted: Wed Jun 27, 2012 8:37 pm    Post subject:
Reply with quote

Quote:
Just curious - is it possible to do:

Code:
:A.B.C.D


Why dont you try that yourself icon_cool.gif
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Wed Jun 27, 2012 8:38 pm    Post subject:
Reply with quote

Only if you had tried you would have got the pleasure of finding/trying something new... (pun intended)

it works... icon_cool.gif
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 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
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm


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