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: 187
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: 187
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
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
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


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