join error

IBM's flagship relational database management system
KBS_123
Posts: 4
Joined: Thu Mar 03, 2016 12:54 pm
Skillset: cobol, jcl, db2, vsam, cics
Referer: internet

join error

Postby KBS_123 » Fri Mar 04, 2016 11:10 pm

Code: Select all

EXEC SQL                                    
    SELECT A.EMP_NUM,A.EMP_STATUS,A.LAST_NAME, B.DEPT_NUM,B.DEPT_NAME                  
      INTO :EMP-NUM, :EMP-STATUS, :LAST-NAME, :DEPT-REC.DEPT-NUM, :DEPT-NAME                      
      FROM EMPL1, DEPT1                        
      WHERE  A.EMP_NUM = :WS-EMP-NUM      
      AND    A.DEPT_NUM = B.DEPT_NUM  
END-EXEC


Error messages

Code: Select all

UNDEFINED OR UNUSABLE HOST VARIABLE "DEPT-REC"
UNDEFINED OR UNUSABLE HOST VARIABLE "DEPT-NUM"

enrico-sorichetti
Global moderator
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
Referer: www.ibmmainframes.com

Re: join error

Postby enrico-sorichetti » Fri Mar 04, 2016 11:20 pm

it is not a join error,

Code: Select all

UNDEFINED OR UNUSABLE HOST VARIABLE "DEPT-NUM"


what does the message hint ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort

Raja190
Posts: 36
Joined: Mon Dec 14, 2015 8:13 pm
Skillset: Cobol, cics, jcl, vsam, db2
Referer: google

Re: join error

Postby Raja190 » Wed Jun 15, 2016 10:07 pm

check for the for correct host variable names generated in the DCLGEN.

refer your DCLGEN copy book and updated the variable names. (there might be discrepancies in "-" "_" )


  • Similar Topics
    Replies
    Views
    Last post