Problem:
Here's a basic example:
There is a mainframe table called TUTORIAL.EMPLOYEE.
I log in as MFIREC and in my program I have the following:
EXEC SQL
SET CURRENT PACKAGESET = 'TUTORIAL'
END-EXEC
And next is a declare and open (same as TEST2.CBL included in the product).
To make this work without a qualifier on the open cursor I have to be able to get results back from syspackage for the following:
SELECT * FROM SYSIBM.SYSPACKAGE WHERE COLLID = 'TUTORIAL';
When results are returned, this means that I ran the Bind utility at least once with a collection id of TUTORIAL.
You would also need to have run this bind with a default qualifier of TUTORIAL (if this is not the userid you are logged in as) and with dynamic rules set to BIND.
If you have all this completed you will not get the -805.
But, if you do get the -805.
As note, COLLID is the Collection ID in Gateway Profile.
Resolution:
Query the sqlerrmc.
The information in the sqlerrmc for me shows:
UDB_81_OS390.TEST.LNKP606A.5844424452444131DISTSERV04
This is because I did a set current packageset = 'TEST' and this does not exist.
Using the informaiton from the sqlerrmc, you can determine what syspackage is looking for:
UDB_81_OS390 = location
TEST = Collection ID
LNKP606A = Package Name (-the A)
5844424452444131 = CONTOKEN
DISTSERV = PLAN
So, if I run the following SQL on UDB_81_OS390:
SELECT * FROM SYSIBM.SYSPACKAGE
WHERE COLLID = 'TEST'
AND NAME = 'LNKP606A'
AND CONTOKEN = x'5844424452444131'
;
Notice, contoken is looking for hex value.
I get no result back - which means it doesn't exist, thus the -805.
At this point I could bind the TEST Collection ID with package name LNKP606, dynamic rules set to Bind and default qualifier = TUTORIAL and the -805 would be resolved.
#EnterpriseDeveloper
#MFDS




