COBOL 66 with Object Cobol extensions Microfocus Cobol (721 659)
Microfocus Cobol (721 659 592)
method-id u.
local-storage section.
77 i pic s9(9) comp.
77 c pic 9 occurs 10 value 0.
77 g pic 9.
01 s pic 9(9).
01 t redefines s pic 9 occurs 9.
linkage section.
77 n pic s9(9) comp.
77 d pic x.
88 f value is 'y'.
procedure division using by value n returning d.
move n to s.
move 'n' to d.
perform p varying i from 1 by 1 until i greater than 9 or f.
goback.
p.
move t (i) to g.
if c (g) is not zero then move 'y' to d.
add 1 to c (g).
end method.
Hmmm, I think I should go back to pitch & putt :(
EDIT: OMGZ I CAN USE LOWER CASE!!!