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



Hey guys,

I am getting some compiler errors and need help getting them fixed. My
database has been created in SQL (not DDS) and are now using actual
date data types. I am now trying to process these fields in an RPG
program.

In my compiler listing, my field I want is defined as:
     D DAPIINSTIN                    10D   DATFMT (*ISO-)
which is brought in via:
     D gResultDs     E DS                  EXTNAME(DBAPAPI)

So now I want this to print on a report. Not knowing exactly how to do
this, I decided to define the field as text like this:
     A            INV_DATE      10   O    +1

Then I used this code to get it into this field.
inv_date = %char(%date(dapiinstin:*USA));
I want to get the date to display as 04/02/2005. This gave me a
compiler error saying "The first parameter of %date is not the correct
format" or something close to that. So after talking to another person
I know, we talked about trying this:
inv_date = %char(%date(%char(dapiinstin):*USA));
This gives me this error: "The types of the right and left hand side
do not match in the EVAL operation."

So my question is, how do I get this to work?

I did see in the archives something about this: 
You need this at least to prevent your error...
     C/EXEC SQL                             
     C+ SET OPTION DATFMT = *USA            
     C/END-EXEC
But I don't know if this would help me in this case. 

Thanks for any help!

-- 
Mike Wills
Midrange Programmer/Lawson Administrator
koldark@xxxxxxxxx
http://www.mikewills.name
Want Gmail? Email koldark+gmail@xxxxxxxxx to get on my waiting list.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.