From: SourceForge.net <no...@so...> - 2012-08-03 15:48:05
|
Bugs item #3540480, was opened at 2012-07-05 07:49 Message generated for change (Settings changed) made by miesfeld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=3540480&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: External Functions Group: v4.0.1 >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: PaulD (pdunkl) >Assigned to: Mark Miesfeld (miesfeld) Summary: RxFuncquery broken on SUSE SLES10 SP4 on IBM System Z Initial Comment: RxFuncquery always returns 0 irrespective of registration state of a module. Experiencing on 32-bit exection on SLES10 SP4 on z/Linux (IBM System Z) platform ---------------------------------------------------------------------- >Comment By: Mark Miesfeld (miesfeld) Date: 2012-08-03 08:48 Message: I'm closing this based on PaulD's latest comments. It is not a bug in RxFuncQuery(). ---------------------------------------------------------------------- Comment By: PaulD (pdunkl) Date: 2012-07-31 11:45 Message: I noticed that now the RxFuncquery() is giving a result other than 0. Strange, and so this time I went looking for more clues. It turned out that RXQUEUE OS queuing function was giving a segmentation fault, and in some cases REX121 errors. Looking up old bug report 2813308 gave me the info I needed to determine that the "rxapi" init.d script was not running. Modifying the simple "test-cmd.rexxx" script to include the following lines; say "RxFuncquery('sqlexec') " RxFuncquery('sqlexec'); say "Rxfuncadd('sqlexec','db2ar','sqlexec') " Rxfuncadd('sqlexec','db2ar','sqlexec'); say "RxFuncquery('sqlexec') " RxFuncquery('sqlexec'); I ran it when the "rxapi" script was down, and then started the script and then ran it again afterwards. The result was as follows: /home/db2admin/vse DBA-1>rexx test-cmd.rexx RxFuncquery('sqlexec') 1 Rxfuncadd('sqlexec','db2ar','sqlexec') 1 RxFuncquery('sqlexec') 1 SQLCA.SQLCODE = SQLCA.SQLCODE SQLCA.SQLCODE = SQLCA.SQLCODE /home/db2admin/vse DBA-1>sudo /etc/init.d/rxapid start Starting rxapi: /home/db2admin/vse DBA-1>rexx test-cmd.rexx RxFuncquery('sqlexec') 1 Rxfuncadd('sqlexec','db2ar','sqlexec') 0 RxFuncquery('sqlexec') 0 SQLCA.SQLCODE = SQLCA.SQLCODE sqlexec() returns ret: 0 SQLCA.SQLCODE = -1024 /home/db2admin/vse DBA-1> SQLCA.SQLCODE = -1024 is expected as it i simply telling me that I did not establish a Database CONNECT session beforehand. If the DB2 function library was not loaded then the SQLCA.SQLCODE variable would be uninitialized. So now the function behaves. It appears that my problems stem from the fact that "rxapi" is not starting up on boot or reboot of the system. I do not know why at the moment as I have used both YaST2 and INSSERV to enable it in the SLES10 on System Z environment. At this point it appears that this may be outside the control of REXX and so I will agree to close this incident. ---------------------------------------------------------------------- Comment By: PaulD (pdunkl) Date: 2012-07-31 09:11 Message: I know you say that my code is backward but it was purposefully done in order to work around the failing of the RxFuncQuery(). In effect I was coding the parts but negating the RxFuncQuery() return value in order to force the correct load of the function using RxFuncAdd(). When the code is stabilized all I need to do is remove the negation. Here is your supplied code snippet. I have modified with parameters needed to make the "sqlexec()" function work; /* ------- Begin code snippet ---------- */ sq1='select * from sysibmadm.dbpaths' say 'SQLCA.SQLCODE = 'SQLCA.SQLCODE; If RxFuncquery('sqlexec') == 0 then do -- Okay sqlexec() is available, call it ret = sqlexec('PREPARE s1 from :sq1') say 'sqlexec() returns ret:' ret end say 'SQLCA.SQLCODE = 'SQLCA.SQLCODE; /* ------- End code snippet ---------- */ Here is the output from that code snippet run; /home/db2admin/vse DBA-1>rexx test-cmd.rexx SQLCA.SQLCODE = SQLCA.SQLCODE SQLCA.SQLCODE = SQLCA.SQLCODE Here is the same code snippet again, but without the '==0' strictly equal object qualifier; /* ------- Begin code snippet(2) ---------- */ sq1='select * from sysibmadm.dbpaths' say 'SQLCA.SQLCODE = 'SQLCA.SQLCODE; If RxFuncquery('sqlexec') then do -- Okay sqlexec() is available, call it ret = sqlexec('PREPARE s1 from :sq1') say 'sqlexec() returns ret:' ret end say 'SQLCA.SQLCODE = 'SQLCA.SQLCODE; /* ------- End code snippet(2) ---------- */ Again the output from the run; /home/db2admin/vse DBA-1>rexx test-cmd.rexx SQLCA.SQLCODE = SQLCA.SQLCODE 23 *-* ret = sqlexec('PREPARE s1 from :sq1') REX0043E: Error 43 running /home/db2admin/vse/test-cmd.rexx line 23: Routine not found REX0417E: Error 43.1: Could not find routine "SQLEXEC" Note that the second method is what is documented in the manual. Do advise on what I may doing incorrectly, or if you need further test output. ---------------------------------------------------------------------- Comment By: Mark Miesfeld (miesfeld) Date: 2012-07-20 18:47 Message: The docs for RxFuncQuery() say: Queries the list of available functions for the function name. It returns a value of 0 if the function is registered, and a value of 1 if it is not. So, your logic looks backwards to me. And you're test code snippet doesn't prove anything. In this snippet you have: say \RxFuncquery('sqlexec'); and the output is 1, so RxFuncQuery() is returning 0 saying the function sqlexec() is available. Without seeing an entire program, I'd say okay, you asked if the function is available and RxFuncQuery() says it is. What happens if you write this code: If RxFuncquery('sqlexec') == 0 then do -- Okay sqlexec() is available, call it ret = sqlexec(<fill in arguments, I don't know them>) say 'sqlexec() returns ret:' ret end If you demonstrate that RxFuncQuery() returns 0 saying a function is available, but it is NOT available, then I'd say that was a bug. All you've shown here is that the interpreter says sqlexec() is available. So, I'd have to assume it is available. ---------------------------------------------------------------------- Comment By: PaulD (pdunkl) Date: 2012-07-05 08:04 Message: Need to run DB2 Database interface from REXX but the interface is 32-bit code. Therefore had to rebuild rpms from source to create 32-bit execution: /home/db2admin/vse DBA-2>rexx -version Open Object Rexx Version 4.0.1 Build date: Jul 3 2012 Addressing Mode: 32 Copyright (c) IBM Corporation 1995, 2004. Copyright (c) RexxLA 2005-2009. All Rights Reserved. This program and the accompanying materials are made available under the terms of the Common Public License v1.0 which accompanies this distribution. http://www.oorexx.org/license.html /home/db2admin/vse DBA-2> After install of rpm file I had to issue the following command to move the location of the installed libarary modules links: sudo mv /usr/lib64/librexx* /usr/lib/ before I could get access to the DB2 module function, namely "/opt/IBM/db2/V9.5/lib32/libdb2ar.so" in my case. When I run the following bit of code: ... If \RxFuncquery('sqlexec') Then If Rxfuncadd('sqlexec','db2ar','sqlexec') Then do; say "Unable to load sqlexec function"; /* Return */; end; say 'sqlexec'; say \RxFuncquery('sqlexec'); say Rxfuncadd('sqlexec','db2ar','sqlexec') ; say \RxFuncquery('sqlexec'); ... I get the following result: sqlexec 1 0 1 The RxFuncquery function is not working according to the doc. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=3540480&group_id=119701 |