Bill, Is your routine a sub procedure or a module? I usualy do this sort of thing with a subprocedure. The sample syntax I use is in the code example. Code
It is a sub_procedure. I got to the part in your book about functions and realized that we already had a suib-proc that will take any form of character date and translate it to a real date. So I followed the examples on page 189. The odd thing is the message. I can see that the *SRVPGM exists in BBARNES. I am moderately confused. Bill
This is my first attempt at a FUNCTION and have failed. I have a program that will take a character date of any type and return a true date field back. I created a *SVRPGM with the name SQLFUNCS in library BBARNES I then used the following to create the function create function BBARNES/CVTDATE (in varchar(10)) returns date external name 'BBARNES/SQLFUNCS(CVTDATE)' language rpgle parameter style general I got back the following. CREATE FUNCTION statement complete. I then tried the following statement in STRSQL SELECT * FROM GASP0030 WHERE TXDATE = CVTDATE('121504') and got the following message. SQLFUNCS in BBARNES type *SRVPGM not found. then I tried this SELECT CVTDATE('120404') FROM GASP0030 FETCH FIRST ROW ONLY And got this in return. SQLFUNCS in BBARNES type *SRVPGM not found. The following is a partial listing from library BBARNES SQLFUNCS *SRVPGM RPGLE SQLFUNCS *MODULE RPGLE Verify date entered and pass back dat What's wrong? TIA Bill Barnes
It was a matter of getting the names all straightened out. If you want to email me directly at kevin.forsythe@dmcconsulting.com, I will try to help you out. Or you can post here and I will check back. Take care, Kevin
Comment