That nasty scope terminating period after DISPLAY INPUTC.
is terminating the scope of the nested PERFORM
statements. Get rid of the period and all should work fine.
The only periods you should ever use in the Procedure Division when coding a program to COBOL-85 standard are the ones required to terminate section and paragraph headers and another one to terminate the current paragraph, section or program.