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



Henrik

I agree, the calling program should be changed.

I assumed that this was not an option.

So using the fact that pointers only are passed here, and that it seems the CALLED program could be changed, simplest answer is to define the incoming parameter of the called program as 5S 0.

A more comprehensive change is desirable, albeit maybe not possible in the OP's working environment. We were not told that, however. :)

Regards
Vern

On 1/27/2013 6:27 AM, Henrik Rützou wrote:
The problem is old and goes back to converting from S/36 to AS/400
where the in the files and programs was a lot of ZONED fields.

If you have to change the field to anything the best thing is to change
the field in all programs to PACKED because things will go terrible
wrong if the field ever are passed to a CLLE program.

Programs calls other programs for a reason and the most likely
reason is that the called program also are used by a number of
other programs.

So instead of making a quick fix leaving one with potential
unpredictable problems other places in the system good
change management would be to address and fix the
problem once and for all instead of leaving a lot of messy
code floating around in the system.

IMO, and I may be a little code perfectionistic, a quick fix
strategy will always be more "expensive" than dealing with
a problem with a long sustainable strategy if it is possible,
that is you have all the source code.

When I wrote the /free code snippit dealing with a alpha field with
numeric negative data it was more for fun and to prove that
RPGLE /free of course can handle any data conversions
if you know your bits and bytes and some of the seldomly used
excotic operation codes.







On Sun, Jan 27, 2013 at 7:11 AM, Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx>wrote:

Hi Barbara

So far as I can tell, the calling program was moving the zoned value
into a 5A field, which was passed to the called program. The OP
complained that there was a letter in the last position. This said to me
that the first nybble had the sign.

Someone, and you, as well, suggested that defining the incoming
parameter as 5S 0 would do it - I think that, as well. For others, since
a pointer is passed to the location of the passed value, then the called
program gets that content in memory, which will be an actual ZONED number.

I did suggest, because it is easier to understand, the use of a data
structure with overlaid subfields to accomplish the same thing, in which
the called program parameter would also be A5.

Easy-peasy!
Vern

On 1/25/2013 1:42 PM, Barbara Morris wrote:
On 2013/1/25 2:32 PM, Henrik Rützou wrote:
the OP asked how to pass a numeric field with possible negative value
moved into an alpha field between programs and then get it back in to a
numeric field in the recieving program.

My understanding of the original post was that the calling program was
moving the negative value into a character field and passing it to the
called program.

The question was about how to code the called program to receive the
value.
Here's the original post. I still think I am understanding it correctly,
but maybe not ...
http://archive.midrange.com/rpg400-l/201301/msg00347.html

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





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.