× 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 Kim,

jdbc_getCol() will return an alphanumeric string to your RPG program. Passing this string as input to %char() doesn't make any sense, as it's already a character field! The JDBC environment is converting ti to character for you, already.

I would start by looking at the format it's returning (stick some code in there for now that puts it into a character string, so you can display the data in debug.)

Once you know what the format looks like, it should be a simple matter of substrining it and passing it into the %date() and/or %dec() BIFs to convert it to the numeric format you want.

I see Alan posted a routine -- I don't know if the format you're receiving matches what his routine is expecting, but if it is, then perhaps his routine will save you some effort.

-SK


On 12/12/2012 2:22 PM, Kim Massar wrote:
Now I have a new problem, there are fields defined in the sql table as dates ([Original_File_Date] [date] NULL) in MMDDCCYY. In our iSeries file they are defined as numeric, in CCYYMMDD order.

1. Is this something I should not try, or will not be able to, convert when I get the columns? (removing the slashes and reordering fields).
2. I have tried this syntax, but does not work: CRTDT = %dec(%Char((jdbc_getCol(rs:12)):*iso-):8:0) . I get the first and second parameter are not allowed for *Char, so I am guessing I can't define the column number here? My reason for question #1!!




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.