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



You don't say how you are currently defining the record image for SQL use, but if you are using an externally defined DS you may be able to use the current technique since you can simply define additional fields after the initial DS spec. That _may_ cause issues with the pre-compiler though as it can be picky.

It would look like this:

dcl-ds image extname('YOURNAMEHERE');
number packed(5) overlay(IDFL03);
End-ds;

Note that the method you were using (from/to) is long outdated and had you coded it this way:

D ds
D idfl0 5a
D idpml 5p Overlay(idfl0)

Then that option might have been more obvious to you. From/To is soooo 1980s my dear <grin>

An alternative is to use a basing pointer for your idpml field like this:

dcl-s p_idpml pointer Inz(%Addr(IDFL03));
dcl-s idpml packed(5) based(p_idpml);


Jon P.


On Mar 27, 2024, at 11:03 AM, Greg Wilburn <gwilburn@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

I'm converting an older program to free format and SQL RPGLE

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

Since I have the entire record of the table defined in a DS now (for SQL), I can no longer do this (IDFL03 is defined in both)

I can't for the life of me figure out how to handle this on a calc spec...
I tried both of the following:
idpml = %dec(idfl03:9:8);
and
idpml = %dec(idfl03:63:31);

Any help would be appreciated.

TIA
Greg
[Logo]<https://www.totalbizfulfillment.com/> Greg Wilburn
Director of IT
301.895.3792 ext. 1231
301.895.3895 direct
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx<mailto:gwilburn@xxxxxxxxxxxxxxxxxxxxxxx>
1 Corporate Dr
Grantsville, MD 21536
www.totalbizfulfillment.com<http://www.totalbizfulfillment.com>
--
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 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.