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



"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 02/29/2020
05:13:20 PM:
also... when using your srvpgm procedure...

when piece_type = t_packed;
packed_data = *zero;
%subst(char_area:%size(packed_data)-max_byte_len+1:max_byte_len
= %subst(string_buffer:beg_byte_pos:max_byte_len);
return %char(packed_data / (10 ** use_scale));

this return statement produces a data decimal error...
(I honestly not sure the intentions of the return statement
calculations)...

values in debug...

PACKED_DATA = 00000000000000000000000 01Ü1000.
max_byte_len = 9
beg_byte_pos = 1

STRING_BUFFER =
....5...10...15...20...25...30...35...40...45...50...55...60
1 ' A 00000'
61 ' '
121 ' '


can you advise on whats going on?


First, a question... Several posts back I think you said your
packed value was 9.2. Above you set the max_byte_len parameter to 9. But
I'm sure you realize that a packed value of 9.2 is NOT 9 bytes. Would you
explain this to me, please? Thanks.

Otherwise, the intention of the RETURN statement is to align the
packed value by the number of specified decimal positions before
converting it to a numeric character string and passing that back.


Sincerely,

Dave Clark

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.