|
On 2013/1/25 2:48 PM, Henrik Rützou wrote:
Yes Barara and my first solution to recieve a numeric in a alpha fieldwas
d dsx ds
d dsa 1 5a
d dsn 1 5s 0
dsa = parmfield1;
dsn will then have the value of the original field1
My second in only /free was
[... snip code using bit operations ...]
Do you have a better solution WITHOUT changing the interface ?
_If_ it's necessary for the called program to deal with the parameter as
both alpha and zoned, then I guess the data structure mechanism would be
good, although it probably be better to define the dsx structure as a
template and define the parameter directly as LIKEDS the template
structure.
But I don't see anything in the original post to suggests that the
called program actually needs to use the parameter as alpha.
Wait ... hmmm ... is it "changing the interface" to define the called
program's parameter as zoned rather than alpha? Maybe, from a purist
point of view. But I think it would be sufficient to just have a comment
d mypgm pi
// Note: The caller defines the parmField1 as alpha, but it
// actually contains a zoned value, so defining it as zoned here
D parmField1 5S 0
--
Barbara
--
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 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.