View previous topic :: View next topic |
Author |
Message |
niks Beginner

Joined: 25 Feb 2004 Posts: 2 Topics: 1
|
Posted: Tue Apr 20, 2004 7:33 am Post subject: Problem with straight forward numeric MOVE in COBOL. |
|
|
I have two numeric variables defined as:
01 SCREEN-AREA.
05 WS-NUM1 PIC 9(17).
01 WORK-AREA.
05 WS-NUM1 PIC 9(17).
MOVE WS-NUM1 IN SCREEN-AREA TO WS-NUM1 IN WORK-AREA.
SCREEN-AREA comes from CICS. When we enter less than 17 digits on the screen, the WS-NUM1 IN WORK-AREA gets a zero padded in the 17th position.
Example if I enter '1187287 ' on the screen, after the move the WS_NUM1 in work area gets '1187287 0'.
The field on the screen is left justified and is defined as numeric in the screen also.
After checking the compile listing I saw the assembly instructions looked like:
MVC 1456(17,6),700( 8 )
OI 1472(6),X'F0'
My guess is the OI (assembler OR) is creating the problem of the zero in position 17.
The requirement is :
The field has to be left justified in any case, the client will not compromise on that. Both fields have to be numeric so justify left will not work.
I cannot change the compile options as it is done by the config tool. I'm using VS COBOL II Release 4.0.
Is there a way to avoid this problem?
Thanks.
Niks |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
niks Beginner

Joined: 25 Feb 2004 Posts: 2 Topics: 1
|
Posted: Tue Apr 20, 2004 11:45 pm Post subject: |
|
|
Thanks a lot Kolusu.
I tried the compiler option and it worked. I didn't realise until I saw your reply that sign bit validation was causing the problem.
Thanks once again !
niks |
|
Back to top |
|
 |
|
|