View previous topic :: View next topic
|
Author |
Message |
sandeep_yadav_in
New User
Joined: 26 May 2007 Posts: 13 Location: Noida, India
|
|
|
|
Hi Guys,
Can anyone please tell me how to resolve this error? "UNDEFINED or UNUSABLE Host Variable"
DSNH312I E DSNHSMUD LINE 41 COL 21 UNDEFINED OR UNUSABLE HOST VARIABLE "HEMPID"
INSERT INTO EMPLOYEE(EMPID,EMPNAME)VALUES(: HEMPID,: EMPNAME)
I've declared these two variables
WORKING-STORAGE SECTION.
01 HEMPID PIC 9(5).
01 HEMPNAME PIC X(20).
This is the procedure division.
A00-MAIN-PARA.
MOVE '11111' TO HEMPID.
MOVE 'SHYAM' TO HEMPNAME.
EXEC SQL
INSERT INTO EMPLOYEE(EMPID,EMPNAME)
VALUES (:HEMPID,:HEMPNAME)
END-EXEC.
Thanks in advance.. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Sandy,
U have declared HEMPID as numeric but u rmoving string into that
Quote: |
MOVE '11111' TO HEMPID. |
jusdt change it with
Code: |
MOVE 11111 TO HEMPID. |
Hope it helps |
|
Back to top |
|
|
sandeep_yadav_in
New User
Joined: 26 May 2007 Posts: 13 Location: Noida, India
|
|
|
|
Thanks Ekta........
|
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
sandy,
Did that work or is EMPID actually declared as a string? |
|
Back to top |
|
|
sandeep_yadav_in
New User
Joined: 26 May 2007 Posts: 13 Location: Noida, India
|
|
|
|
Hi William,
Yeah it worked......
i also changed the pic clause to
PIC 9(5) USAGE IS COMP-3 |
|
Back to top |
|
|
|