× 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.



Hi all,
 
I'm new to the world of procedures. I am in the process of learning to develop procedures on the Iseries and have run into the following problem:
 
I am developing a procedure that takes an alphanumeric field and converts it to numeric. My problem is that I defined the local variable in the procedure
yet the compile crashes because it says it can't find the object. The code in question is below:
 
d GetPostDate     pr                  like(postdate)         
d   org1                                     like(emporgun1) value  

 
 
GetPostDate     b                                                              
GetPostDate     pi                  like(postdate)                             
Org1                                      like(emporgun1) value                      
ReturnValue     s                   like(postdate)                             
OrgComp#        s              4  0                                            
free                                                                           
                                                                               
  // Convert the company# from character to numeric for the SQL exec command.  
                                                                               
    OrgComp# = %dec(Org1:4:0);                                                 
                                                                               
  // Retrieve the record from DBIFGLS for the company being processed.         
                                                                               
    exec sql select * into :ds_dbifgls from dbifgls where DGLSCMPNY =          
                            OrgComp#;                                          

Here is the error message from the compile below:
 
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8
              exec sql set option commit = *none, naming = *sys;               
                                  OrgComp#;                                     
 
Position 36 Object ORGCOMP# in *LIBL not found.   

To me, everything looks ok and is a relativly simple procedure. What am I doing wrong or missing?
 
Thanks,
 
Arthur

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.