You made the best, this maybe the ermetic structure.
I suppose that STRIP leading zeroes is unuseful in REXX
/*Rexx*/
alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
say d2eng(input_number)
Return
d2eng: procedure expose alphabet
i = arg(1) + 0
output=""
do while i>0
  output=substr(alphabet,i//26+1,1)||output
  i=i%26
end
if 0 = length(output) then return "A"
else return output

If you need to run use it heavly(more than 30 times) you can also use stem
instead substr
i.e.
/*Rexx*/
alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
j = 0 ; str = '' ; len = length(alphabet)
do j = 1 to len
   str = str||j' alpha.'j' +1 '
end
interpret "Parse Var alphabet "str

say d2eng(1)

Return
d2eng: procedure expose alpha. len
i = arg(1) + 0
output=""
do while i>0
  output=Value("alpha."i//len+1)||output
  /* or j = i//len+1
        output=alpha.j||output */
  i=i%len
end
if 0 = length(output) then return "A"
else return output

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to