|
On Mar 27, 2024, at 11:26 AM, Daniel Gross <daniel@xxxxxxxx> wrote:
Hi Greg,
Am 27.03.2024 um 16:03 schrieb Greg Wilburn <gwilburn@xxxxxxxxxxxxxxxxxxxxxxx>:
The table I'm reading contains a character field IDFL03 that contains a packed decimal value.
The previous extraction method (reading the file with RPG) simply defined a DS "overlay"
D ds
D idfl03 1 5a stored here in sa326
D idpml 1 5p 8 payment multiplier
How about using a pointer?
dcl-s packedField packed(9:8) based(pointerCharField);
...
pointerCharField = %addr(idfl03);
...
// now use packedField
Another idea is using SQLs built in INTERPRET function?
SELECT INTERPRET(idfl03 AS DECIMAL(9, 8) FROM ...
This should also work.
Of course the best solution would be converting this column to a numeric value.
HTH
Daniel
P.S.: I'm on holidays right now - so no chance to check my ideas ...
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
As an Amazon Associate we earn from qualifying purchases.
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.