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 variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
amar.mce

New User


Joined: 01 Dec 2007
Posts: 2
Location: india

PostPosted: Fri Dec 14, 2007 7:30 pm    Post subject: host variable
Reply with quote

i have created 2 tables giving 2 DECLGENS

BUT 2 declgens have same host variable name

how to refer the host variables of a particular table

i am getting the error as "HOST VARIABLE WS-ISBN-NUMBER IS AMBIGUOUS".

amarnath
Back to top
View user's profile Send private message

arivazhagan_k

New User


Joined: 05 Dec 2007
Posts: 57
Location: chennai

PostPosted: Fri Dec 14, 2007 7:39 pm    Post subject:
Reply with quote

Quote:
HOST VARIABLE WS-ISBN-NUMBER IS AMBIGUOUS


You have to use that varriable with 01 level qualifier since you are using
same field .[/quote]
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Fri Dec 14, 2007 8:29 pm    Post subject:
Reply with quote

In a typical dclgen you will reference a column name like tablename.columnname. So refer the table name before the column name.
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Fri Dec 14, 2007 9:48 pm    Post subject:
Reply with quote

We use prefixes in our DCLGEN variable names. For example say we have 2 tables TABLEA and TABLEB that both contain the column MYCOL.

The variable names will be:

TABLEA-MYCOL
TABLEB-MYCOL

This approach lets us avoid the cumbersome OF syntax.

Something to consider if you have any control over the creation of the DCLGEN members.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Dec 14, 2007 10:09 pm    Post subject:
Reply with quote

don't think you use OF for qualification in sql. isn't it
hlq.element-name

instead of element-name of/in hlq
?
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Sat Dec 15, 2007 1:29 am    Post subject:
Reply with quote

Dick,
Right, but to setup the variables before executing the SQL, you need to use the of/in syntax. The error message looks to be coming from the COBOL compiler, not the SQL precompile.

Code:

MOVE data to COLA of LEVEL01

EXEC SQL
 SELECT * FROM TABLE
 WHERE COLA = :LEVEL01.COLA
END EXEC
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts OPC JCL Variable passion_sujesh IBM Tools 5 Fri Jul 01, 2016 4:21 am
No new posts JOINKEYs and Variable files migusd SYNCSORT 8 Fri Jun 17, 2016 3:16 am
No new posts PC to Host for unicode file Tom Steiner TSO/ISPF 5 Mon May 16, 2016 10:38 pm


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