× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



David,

We ran into a problem when going to V5R2 with multi-thread jobs using
the 
CLI exits. A UDF will run in a secondary thread. With V5R1 and earlier,
secondary 
threads inherited the primary thread's library list. On V5R2, it
appears that 
IBM changed some code with the CLI exits so that they started using the

secondary thread user's jobd to set the base library list. Is it
possible you 
are seeing something similar? IBM did provide a PTF that seems to work,
but 
at this point it is not generally available.

I was able to prove this by running a call to qcmdexc('dspjob'
x'000000000600000') 
in an SQL statement.

David Morris

>>> DSmith@xxxxxxxxx 9/2/2003 10:49:14 AM >>>
I've created some SQL user defined functions (UDF) that I am using in
my embedded SQLRPGLE programs.  I am having a problem that the UDF will
not use my *LIBL.  In my regular embedded SQL I do not need to specify
the library that contains the file; It uses my LIBL.  The function
however is forcing me to HARDCODE the library in order to work
correctly.   Anybody know what I'm doing wrong?

Below is the code fro the function and the SQLRPGLE program at V5R2:

CREATE FUNCTION GETCEN  (pYear Decimal (2,0))  
Returns Decimal(2,0)  
Language SQL  
Reads SQL Data  
Deterministic  
Returns Null On Null Input   

Begin  
 Declare wCenturyBaseYear Decimal(2,0); 
 Declare wLowCentury Decimal(2,0); 
 Declare wHighCentury Decimal(2,0); 
 Declare pCentury Decimal(2,0);  

Set Path = *LIBL;

Select SYBSYR, SYLCEN, SYHCEN  
 Into wCenturyBaseYear, wLowCentury, wHighCentury  
 From MYFILE   
 Where SYCO = 01 and SYID = '  ';  

If wCenturyBaseYear IS NULL Then  
  Set wCenturyBaseYear = 85;  
  Set wLowCentury = 19;  
  Set wHighCentury = 20; 
End If;   

If pYear > wCenturyBaseYear Then   
 Set  pCentury = wLowCentury; 
Else   
 Set pCentury = wHighCentury; 
End If;  

Return pCentury;  

End -- GETCEN;


Below gives me an error at runtime that "MYFILE in MYLIB(which is my
CURLIB) type *FILE not found" even though MYFILE is in my LIBL.
 *                                  
C/EXEC SQL                          
C+ SET :@CENT = GETCEN(:@YEAR)      
C/END-EXEC                          
 *                                                                     
                       

David Smith
IT Consultant
dsmith@xxxxxxxxx 
517.546.5400

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.