View previous topic :: View next topic
|
Author |
Message |
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
i have code a db2 cobol pgm in which i want to access one table named "POLICYTERM" and get some values
is it necessary to include its copybook |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Paul,
It's not mandatory that you include copybook ( assuming its contain DCLGEN) in the program, but if you have, the Pre-complier validates the field name, etc and give you a warning at precompile stage .
Let me know if u need further explaination |
|
Back to top |
|
|
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
^^ YES U R RIGHT I CREATED THE COPYBOOK USING dclgen
this means if i include copybook, it will inform me about wrong SQL statements which i have embedded in the cobol code |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
yes |
|
Back to top |
|
|
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
Hi,
i used following sql code in cobol pgm
EXEC SQL
SELECT DIVISION_ID
INTO :HOLD-DIV-ID
FROM GIPIF$01.POLICY
WHERE ZONE_ID = :HOLD-ZONE
AND POLICY = :HOLD-POLICY-NUMBER
AND SYMBOL = :HOLD-SYMBOL
AND MODULE = :HOLD-MODULE
AND MCO = :HOLD-MCO
END-EXEC
but the problem is that it is not fetching any value from table, i displayed the sqlcode and it is showing as 92P
could u pls throw some light |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The 92P is most likely a -927 (P is the signed numeric for a negative 7).
If you search in this forum, you will see info on an SQL -927.
Quote: |
THE LANGUAGE INTERFACE (LI) WAS CALLED WHEN THE CONNECTING ENVIRONMENT WAS NOT ESTABLISHED. |
|
|
Back to top |
|
|
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
Quote: |
Hello,
The 92P is most likely a -927 (P is the signed numeric for a negative 7).
If you search in this forum, you will see info on an SQL -927.
Quote:
THE LANGUAGE INTERFACE (LI) WAS CALLED WHEN THE CONNECTING ENVIRONMENT WAS NOT ESTABLISHED.
_________________
Hope this helps, |
hi, thnx a lot, so the sqlcode which i am getting, is this bcos of fault from my side or system side |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
Paul,
The sqlcode that u r getting can be both system side as well as user side it depends on situation , in order to get the sql code to a readable format move the sqlcode to a edited picture clause and then display the same .
Code: |
77 sql-disp pic -9(3).
.
.
.
Move SQLCODE to sql-disp.
display sql-disp. |
For -927 try to get the exact DSN name of your DB2 subsystem like DB2p or DB2D etc.. contact your manager for this.
Thamilzan. |
|
Back to top |
|
|
noorkh
New User
Joined: 06 Mar 2006 Posts: 76 Location: Chennai
|
|
|
|
Otherwise you can even move it to some packed decimal field and write in file to check it. |
|
Back to top |
|
|
paul_007
New User
Joined: 03 Aug 2006 Posts: 33 Location: earth
|
|
|
|
Quote: |
Paul,
The sqlcode that u r getting can be both system side as well as user side it depends on situation , in order to get the sql code to a readable format move the sqlcode to a edited picture clause and then display the same .
Code:
77 sql-disp pic -9(3).
.
.
.
Move SQLCODE to sql-disp.
display sql-disp.
For -927 try to get the exact DSN name of your DB2 subsystem like DB2p or DB2D etc.. contact your manager for this.
|
thnx 4 help , i did wat u said and it is displaying the sql code correctly, idat wat u call "edited field ", correct me if i am wrong
and my DSN name is DSNP |
|
Back to top |
|
|
|