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 OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm


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