You can use %Editc function to convert numeric to character or vise versa.
Ex: eval #charvar = %editc(#numvar:'4')
Check this link
http://publib.boulder.ibm.com/iseries/v5r1/ic2924/books/c0925083557.htm
Regards,
Chamara Withanachchi
IBM Certified Power System Expert
RPG Programmer
(owner of www.rpgiv.info)
WWW.RPGIV.INFO
Mob: +971 50 5698644
Tel: +971 6 5595887
chamaraw@xxxxxxxxxx
www.rpgiv.info
i want to be future ready. i want control. i want an i.
Sent from my BlackBerry® wireless device
-----Original Message-----
From: "Al" <macwheel99@xxxxxxxxxx>
Date: Wed, 25 Mar 2009 02:43:41
To: <midrange-l@xxxxxxxxxxxx>
Subject: Variable tips
My latest assignment is to construct a string of "fields" of variable
length, separated by commas, to supply a customer's specifications. My
source fields are predictable lengths, but I need to chop off leading zeros
& trailing blanks.
I expect I'll need a standard subroutine to do the chopping, one for
numeric, one for alpha fields, which will also return the resulting length
value, and the field edited, eg. 1234.567 (no commas at thousands, because
commas separate output fields) (decimal places vary but are fixed by field).
I am still unsure how to address (keep track of)
"we're now at field 14, sideways position 101" or whatever, maybe use report
ending position plus a # if a variable can go there for the plus value.
I'm on V5R1, more comfortable with RPG/400 than RPG/ILE. All my past
programming has been with fixed length fields.
I could use some tips as I stumble into this (for me) new mine field.
-
Al Macintyre
-
Home PC in midst of replacement.
As an Amazon Associate we earn from qualifying purchases.