Keep it simple by having a parm string like:
parm1=XX,parm2=123,,
I have used this for many years having procedures to build the parm-string
and extract the values:
Calling program builds the parm string:
clear TokString;
TokString = PutTokenStr(TokString :TokLine :C1LINE);
TokString = PutTokenStr(TokString :'function':%char(S1FUNC));
WorkAccounts(TokString);
Resulting parm string
TokString: line=NC,function=100,
ProgramToCall(TokString);
Called program analyze the parm string:
TokCount = GetTokens(p_parms:%addr(tokens));
GetTokNames (TokCount:%addr(tokens):%addr(TokNames));
GetTokValues(TokCount:%addr(tokens):%addr(TokValues));
Getting parm 1:
C1LINE = GetTokValue(TokLine :TokCount:TokNames:TokValues);
Getting parm 2:
if GetTokValue('function':TokCount:TokNames:TokValues) <> *blanks;
C1FUNC = %dec(
GetTokValue('function' :TokCount:TokNames:TokValues)
:3:0);
endif;
Resulting field values:
C1LINE = NC
C1FUNC = 100
The handling of numeric parm 2 could use some improvement.
-----Oprindelig meddelelse-----
Fra: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> På vegne af Birgitta
Hauser
Sendt: 27. februar 2026 08:45
Til: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Emne: New IBM idea - Named Parameters at Program and Procedure Calls
I have added a new IBM idea, to allow specifying Parameter Names (and
assigning the parameter values) at program/procedure calls (in the same way
as you can do it with SQL Stored Procedures, UDFs and UDTFs)
https://ideas.ibm.com/ideas/IBMI-I-4826
Please LIKE if you think it would be helpful/useful
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
Modernization ? Education ? Consulting on IBM i Database and Software
Architect IBM Champion since 2020
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok) "What is
worse than training your staff and losing them? Not training them and
keeping them!"
"Train people well enough so they can leave, treat them well enough so they
don't want to. " (Richard Branson) "Learning is experience ? everything else
is only information!" (Albert
Einstein)
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Barbara
Morris
Sent: Thursday, 26 February 2026 18:50
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: CCSID - RPG issues
On 2026-02-26 8:40 a.m., Birgitta Hauser wrote:
SQL could always handle single byte and double byte character sets ...
and
UTF-8 correctly. Transformation occurred automatically.
The problem was always RPG because the data is converted into the Job
CCSID.
BTW what is your Job CCSID? 65535?
He has DATA(*NOCVT) for the file and CCSID(*EXACT) for the data structure,
so it should not be converting the data to the job CCSID.
With DATA(*NOCVT), it should get the data correctly even if the job CCSID is
65535.
--
Barbara
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.