Ambiguous host variable.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Ankur Goyal
New Member
Posts: 5
Joined: Sat Jun 07, 2014 4:25 pm

Ambiguous host variable.

Post by Ankur Goyal »

Hi,

I've two tables with two DECLGENs. In these DECLGENs, I have same host variable names. Now how to refer the host variables of a particular table in the program? I get this error:

Code: Select all

 "HOST VARIABLE WS-SSN-NUMBER IS AMBIGUOUS". 
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

Re: Ambiguous host variable.

Post by zprogrammer »

What you could do is something like below

WS-SSN-NUMBER IN <01 level OF DCLGEN>

If your DCLGEN is like

01 user
03 ws-ssn-number

Then you need to access like

WS-SSN-NUMBER IN USER
zprogrammer
Rahul Dhoble
New Member
Posts: 6
Joined: Sun Apr 27, 2014 10:47 am

Re: Ambiguous host variable.

Post by Rahul Dhoble »

Pandora-Box is correct. You've to use the "..OF 01-group-level" to distinguish the similar variable names.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Ambiguous host variable.

Post by William Collins »

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”