! DECIMAL TO OCTAL DUMPING PROGRAM
! AA - FOR IMPICS DEBUGGING
  %BEGIN
  %INTEGERARRAY IFILE(1:2500)
  %INTEGER I,K
  %ROUTINESPEC OCDUMP(%INTEGER N)
  %FAULT 9-> 100 ; ! FOR INPUT ENDED
    SELECT OUTPUT(0) ; SELECT INPUT(0)
  %CYCLE I=1,1,2500
    READ (IFILE(I))
  %REPEAT
 100 : CLOSE INPUT
  %CYCLE K=1,1,I
    NEWLINE ; OCDUMP(IFILE(K))
  %REPEAT
  %STOP
! END OF MAIN PROGRAM
  %ROUTINE OCDUMP(%INTEGER N)
  %INTEGER L,J
  %SWITCH S(0:7)
  %CYCLE L=15,-3,0
    ->S((N>>L)&7)
 100 : %REPEAT
  %RETURN
 S(0) : PRINT SYMBOL('0') ; -> 100
 S(1) : PRINT SYMBOL('1') ; -> 100
 S(2) : PRINT SYMBOL('2') ; -> 100
 S(3) : PRINT SYMBOL('3') ; -> 100
 S(4) : PRINT SYMBOL('4') ; -> 100
 S(5) : PRINT SYMBOL('5') ; -> 100
 S(6) : PRINT SYMBOL('6') ; -> 100
 S(7) : PRINT SYMBOL('7') ; -> 100
  %END
  %ENDOFPROGRAM

