View previous topic :: View next topic
|
Author |
Message |
rini
New User
Joined: 16 May 2006 Posts: 6
|
|
|
|
When i tried moving a variable with declaration 9(2).9(2) to a variable with declaration S9(2)V9(4) i m getting S0C7. is there any way to rectify. as of now i cant change the declaration of both the variables |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi Rini,
You must have to check the value inside both the variables, Exped both the variables by using command PEEK, might be ur variables contain the garbage value which leads to SOC7. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
9(2).9(2) is an edit mask x type REFERENCE Name = A
S9(2)V9(4) is a numeric display REFERENCE Name = B
COMPUTE B = FUNCTION NUMVAL(A) |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
It shouldn't give SOC7 value as both are numeric. Check the field values you are moving.
Regards,
KSK |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
KSK,
Wat u want to suggest its not obvious? |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Vasanth,
Don't use obvious. Nothing is obvious. Some persons may not know some things. IF YOU KNOW, IGNORE IT. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
ksk,
both fields are not numeric. |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Hi Dick,
Thanks for the response. Are both fields are not numeirc? If not, can I know which one is not Numeric?
KSK |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
9(2).9(2) is an edit mask, it is x type, REFERENCE Name = A
S9(2)V9(4) is numeric display, REFERENCE Name = B
COMPUTE B = FUNCTION NUMVAL(A) |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1050 Location: Richmond, Virginia
|
|
|
|
I think what we are saying is that the 9(2).9(2) is a character field containing a "." - so cannot be moved to a numeric field. |
|
Back to top |
|
|
rahul.banik
New User
Joined: 23 Jan 2007 Posts: 16 Location: Mysore
|
|
|
|
hi rini,
This is a valid move.i've tested this with a valid numeric value and it's not giving any S0C7.I think ur variables contain some garbage value which leads to SOC7 error. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
In recent COBOL Versions moves of num/ed fields are de-edited and converted as part of the move. |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Hi Dick/Phrzby,
I have tested with the above picture classes, it was not giving S0C7 error.
I declared the variables as shown below.
01 K PIC 9(2).9(2).
01 K1 PIC S9(2)V9(4) VALUE 0.
MOVE 1025 TO K.
Results were
K=25.00
K1=25000{
KSK |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi KSK,
Is it not obvious? |
|
Back to top |
|
|
|