If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Does anyone know how I convert this numeric 1291.12-
into 000012911K? I believe that is the ASCII value of the 1291.12 number.
Thanks,
DAC
Well the ASCII value would normally be expressed in hex so I'm assuming you mean the character equivalent.
We're talking RPG here so it would be EBCDIC anyway so I'm really confused by the question.
Anyway - assuming what you meant was character format then the answer is simple. (Code format not correct).
Code:
D MyCharVersion DS
// Note the "S" data type must be used or this will not work
D MyNumVersion 10s 2
D InputNumber 10p 2 Inz(-1291.12)
/Free
MyNumVersion = InputNumber; // Assuming source is zoned or packed
// MyCharVersion now contains the required characters
// If input is character then
MyNumVersion = %Dec('-1291.12');
Comment