I am studying cobol on my own but have a serious problem,hope somebody can help me:
data division.
working-storage section.
01 tval pic 999.
01 redefines tval.
03 pic x.
03 sign pic x.
01 ascii pic 999.
procedure division.
main.
move 0 to tval
display "enter sign"
accept sign no beep
move tval to ascii
display "sign is:" ascii
stop run.
The problem is in the working-storage section. Why not just write:
01 sign redefines tval; pic xxx.
I 've tried this but it doesn't work pretty good,got the wrong result. But why???