|
On 23-Feb-2018 15:33 -0700, Justin Taylor wrote:
I have a program-described PF that contains packed decimal data.https://www.mcpressonline.com/programming/sql/techtip-accessing-packed-data-in-flat-files
Our Windows manager insists it can be queried directly. The only
way I know how to read packed decimal data is with RPGLE I-specs.
Is there something I'm missing?
SELECT
SUBSTR(CUSTFLAT,4,30)
, DECIMAL(SUBSTR(HEX(SUBSTR(CUSTFLAT,1,3)),1,5),5,0)
* CASE
WHEN SUBSTR(HEX(SUBSTR(CUSTFLAT,3,1)),2,1) ='F'
THEN 1
ELSE -1
END
FROM CUSTFLAT
Of course this gives you a number without decimals...
I'd suggest creating a view over the PF...
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.