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



Jerry,

I wrote up a quick program to mimic yours but with a little twist.

o I defined the parameters as you did.
o I defined a variable for %parm.
o I defined a variable for %parm().
o I defined a flag as you did.
o I included a program status data structure.

Here's the program...

H Debug(*YES)
H Dftactgrp(*No) Actgrp(*New)
H Option(*SrcStmt)

D ProgramSDS SDS
D Pgm_Name *PROC
D Pgm_NbrParms *PARMS

D TEST1 PR extPgm('TEST1')
D parm1 2A OPTIONS(*NOPASS)
D parm2 2A OPTIONS(*NOPASS)

D TEST1 PI
D parm1 2A OPTIONS(*NOPASS)
D parm2 2A OPTIONS(*NOPASS)

D flag1 S N inz(*off)
D NBRPARMS S 10I 0
D NBRPARMS2 S 10I 0

/free

if %parms > 0;
flag1 = *On;
endif;

NBRPARMS = %PARMS;
NBRPARMS2 = %PARMS();

dump;


*INLR = *On;
return;
/end-free

%parm worked for me. Here is what I see from the dump after executing call test1 'x'

PARM1 CHAR(2) 'x '
PARM2 CHAR(2) NOT ADDRESSABLE
FLAG1 INDICATOR(1) '1'
NBRPARMS INT(10) 1
NBRPARMS2 INT(10) 1
PGM_NBRPARMS ZONED(3,0) 001


This was at V5R4. The program was compiled to use a *NEW activation group.

Gary Monnier


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jerry C. Adams
Sent: Tuesday, July 10, 2012 10:51 AM
To: 'RPG programming on the IBM i / System i'
Subject: RE: %Parms Test Problem

I'll take your word for it, Jon. Per my previous reply, it worked when I removed the *NoPass options and tested via the command line.

Jerry C. Adams
IBM i Programmer/Analyst
Karl Imhoff was a German engineer who developed sewage treatment systems in the early 1900's. His biggest contribution was the Imhoff Tank, which allows sewage to settle. The Imhoff Law relates to bosses everywhere. The law goes as follows: The largest chunks always rise to the top.
--
A&K Wholesale
Murfreesboro, TN
615-867-5070


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx<mailto:rpg400-l-bounces@xxxxxxxxxxxx> [mailto:rpg400-l-bounces@xxxxxxxxxxxx]<mailto:[mailto:rpg400-l-bounces@xxxxxxxxxxxx]>
On Behalf Of Jon Paris
Sent: Tuesday, July 10, 2012 12:47 PM
To: rpg400-l@xxxxxxxxxxxx<mailto:rpg400-l@xxxxxxxxxxxx>
Subject: Re: %Parms Test Problem

Ignore me Jerry - I was thinking bound calls ...

If only my brain would engage ...


On 2012-07-10, at 1:37 PM, rpg400-l-request@xxxxxxxxxxxx<mailto:rpg400-l-request@xxxxxxxxxxxx> wrote:

I don't think the command line (which it looks like you are using)
passes
the minimal descriptors that are needed for %parms to work Jerry.

Try calling from another RPG or CL and it should work.

Jon Paris

www.partner400.com<http://www.partner400.com>
www.SystemiDeveloper.com<http://www.SystemiDeveloper.com>




--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx<mailto: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<mailto:RPG400-L-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx<mailto: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<mailto: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.