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



I follow all of that, Paul. The piece I am missing is that I want to have a logical file, and use that logical as an externally defined file in my RPG program. I am not wanting to sort on the 4-column, packed, 7/2 field, but I do want to get the right value for the field. How does the RPG program know that the field is a packed numeric and not a 4-char field? Where do I define that?

PaulMmn wrote:
A packed field can -only- have an odd-number of digits! Because you have 1/2 byte for the sign, either count the bytes by odd numbers (1-3-5-7) until you've counted up to the number of bytes, or calculate-- ((#ofBytes * 2) - 1). Even if you describe the field with even numbers, you still get an extra half-byte once the data's stored on disk.

As far as sorting... it doesn't matter if you have a character, packed, or binary field-- sorting on the field still comes out in the right sequence.

--Paul E Musselman
PaulMmn@xxxxxxxxxxxxxxxxxxxx



At 11:49 AM -0600 12/24/08, Troy Foster wrote:
or 6,2

On 12/24/2008 11:46 AM, Booth Martin wrote:

I went back and looked at my source. sheeeshhh... I had already done
this back in 2003. But I had never made it work because I couldn't
figure out how to substring a packed field.

The program described file has columns 28-31 as packed, 2 decimals.
That is 7/2, right?
What is the SST? SST(field 28 4) doesn't seem right and I am not
even sure how to test it.
------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.0/1863 - Release Date: 12/24/2008 11:49 AM



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.