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



Florin Todor - YYZ Concord wrote:

I try to pass a char parameter of 100 to an RPG program. The problem
is, starting position 34 (if the actual data I'm passing is less than
that) is filled out with garbage. When I try to trim the parameter (in
order to use only what I need it), I cannot do it because of that...

Florin:

When you pass the value, are you passing all 100 characters including trailing blanks? For example, if you issue the CALL from a command line, are you putting the parameter value in quotes with the trailing quote far enough out to include all necessary blanks?

If you don't, then whatever is in memory is what will get picked up by your RPG program. You have to put blanks into the memory in some way.

One way to do that is to define a *CMD object over the RPG program that declares the parameter to be 100 characters long.

If you're going to call the RPG program from a CL program, then the CL program is responsible for making sure that the memory is correct out to 100 characters. If the CL program receives the value in its parameter list, then whatever calls the CL is responsible for the memory being correct.

Tom Liotta


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.