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



You have to pass as ' 256 characters ' to tell the command processor to
create a 256a variable. The better option is to just create a command with
a 256a parameters and it does it all. This same behavior will occur in any
other program because it is about the command interpreter.

Think of yourself as the command interpreter. All you get from the command
line is strings of characters. Based on analyzing the strings, you decide
what kind of variables to create and pass to your program. If it sees this,
1233, it says oh must be a number and passes it as a 15.5 number. If it
sees this abc, it says it must be a character string and creates a 32 byte
character field. If it sees 'agc', it says must be a 3 character alpha
field and passes a 3a field. So the only way to get a 256a field is to use
a command or type the quotes and an entire 256a field.
. .

On Wed, Feb 11, 2015 at 3:20 PM, Pete Helgren <pete@xxxxxxxxxx> wrote:

I have spent too much time in the Java/JavaScript world apparently because
I have been attempting to write what I thought was a simple RPGLE program
which I can call from a command line. The problem is that the parameter,
which is a character type, 256 in length, gets padded with "unexpected"
contents beyond what I am submitting on the command line. If I submit it
like so:

CALL PGM(MYPGM) PARM(This is a test') I see something like this when I
view the contents in either debug or the receiving program:

This is a testRPGLESRC MYLIBRAY MYPGM ??*SRCMBRTXT ‑ 1? *HEX *JOBRUN1 0
*NEW 0*LIBCRTAUT1 *CURRENT0*NONE

I understand, from reading numerous posts, that this is normal behavior
but my attempts to follow the directions to eliminate the issue seems for
naught. I couldn't find an example program in all of MY libraries that
does something similar without the side effects (I could have sworn I have
written RPG programs like this before).

The program has these Prototypes/Procedure interfaces:

D mypgm pr extpgm('MYPGM')
D text 256A varying const options(*trim)

D mypgm pi
D text 256A varying const options(*trim)

I originally defined 'text' as 256A but saw the spurious characters. So
I tried options(*varsize), same result. So I tried varying const
options(*trim). No joy ( get a variable out of range error). It is a
little early in the week to be going brain dead but apparently I have. I
can't seem to sort this out.

I want to pass a character string of up to 256 characters into this
program and only get the characters typed as the parameter value. What am I
missing?

--
Pete Helgren
www.petesworkshop.com
GIAC Secure Software Programmer-Java

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