PDA

View Full Version : Cobol-problem



Unregistered
07-23-2002, 08:19 AM
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???

Unregistered
07-23-2002, 08:20 AM
forgot something very important:
01 tval pic 999 usage binary !!!!!!!!!!!

CumQuaT
07-25-2002, 08:35 PM
DONT USE COBOL!!!!!!!!!

Delphi! C++! VB! DB! EVEN QB! JUST DONT USE IT! FOR YOUR OWN SAFETY!!!

face_master
07-26-2002, 12:23 AM
VB and QB? I think not...