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



Thanks to all for the help and info. I have downloaded the recommended manuals from the IBM website and away I go!
 
Thanks again,
 
Arthur


________________________________
From: Scott Mildenberger <SMildenberger@xxxxxxxxxxxxxxxxxx>
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Sent: Friday, September 6, 2013 2:25 PM
Subject: RE: Newbie To Procedures With Problem


Any general book on SQL will help you learn the syntax, etc.  From IBM specific to the i are

Redbook - Modernizing Data Access with SQL
Manuals - SQL Programming
                    SQL Reference
                    SQL Messages and Codes.

I didn't look up the links as I have downloaded the pdf's.  They are all available from the InfoCenter.

Scott Mildenberger
Programmer/Analyst
Davis Transport Inc.
Missoula, MT
406-728-5510 x128


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of arthur perkins
Sent: Friday, September 06, 2013 12:15 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Newbie To Procedures With Problem

Thanks for the reply! That did it!
 
Are there any websites I can check out or books I can buy that would be good for someone like me who wants to learn SQL without being overwhelmed?
 
Thanks again for the info!
 
Arthur


________________________________
From: Scott Mildenberger <SMildenberger@xxxxxxxxxxxxxxxxxx>
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Sent: Friday, September 6, 2013 1:57 PM
Subject: RE: Newbie To Procedures With Problem
 

Need a colon in front of the field name OrgComp# like

    exec sql select * into :ds_dbifgls from dbifgls where DGLSCMPNY = :OrgComp#;                                         

Not related to being in a procedure at all, just the SQL syntax.

Scott Mildenberger
Programmer/Analyst
Davis Transport Inc.
Missoula, MT
406-728-5510 x128

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of arthur perkins
Sent: Friday, September 06, 2013 10:28 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Newbie To Procedures With Problem

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

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.