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
 

 

Getting a compilation error for host variables

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

New User


Joined: 16 May 2008
Posts: 36
Location: Kolkata,India

PostPosted: Fri Aug 21, 2009 12:42 pm    Post subject: Getting a compilation error for host variables
Reply with quote

Hi,

I have a cobol db2 program which has the following db2 query embedded in it.

Code:
EXEC SQL                                           
   SELECT  ENTY_ID                                 
   INTO   :WS-ENTY-ID                               
   FROM    TEPPROD                                 
   WHERE   RTRIM(LTRIM(PROD_ID)) = :ROAS-MASTER-KEY
   AND     SRC_FRNCHS_VAL = 'MLFS'                 
END-EXEC                                           


The corresponding declaration of the host variables are as under (in working storage)

Code:
05  WS-ENTY-ID              PIC 9(09) VALUE ZERO.
02  ROAS-MASTER-KEY.                         
  05  ROAS-CURRENT-DAI.                       
      10  ROAS-CURRENT-DISTRICT PIC X(03).   
      10  ROAS-CURRENT-AGENCY   PIC X(03).   
      10  ROAS-CURRENT-INDEX    PIC X(01).   


The table fields types are
ENTY_ID --Integer
PROD_ID -- char 50
SRC_FRNCHS_VAL char 50.

While compilation I am getting an error of

Code:
UNDEFINED OR UNUSABLE HOST VARIABLE "WS-ENTY-ID"     
UNDEFINED OR UNUSABLE HOST VARIABLE "ROAS-MASTER-KEY"


Can anyone help on this.To me it seems that all the declarations have been made and with appropiate data types as well --still i am getting this error
Back to top
View user's profile Send private message

Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Aug 21, 2009 1:03 pm    Post subject:
Reply with quote

Hi Kamlesh,

If I am correct, the equivalent of integer in DB2 is S9(09) COMP in COBOL. Please verify with the manuals...

Secondly, regarding ROAS-MASTER-KEY field, again, if my memory is correct, group variables cannot be directly referred to in a Query. You may be required to redefine the variables to use it.
Back to top
View user's profile Send private message
Kamlesh Kamal

New User


Joined: 16 May 2008
Posts: 36
Location: Kolkata,India

PostPosted: Fri Aug 21, 2009 4:44 pm    Post subject:
Reply with quote

Hi Binop,

Thanks ..it helped...got it resolved..
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Aug 21, 2009 4:46 pm    Post subject:
Reply with quote

Nice to hear that... icon_biggrin.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 -> 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 Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am


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