View previous topic :: View next topic
|
Author |
Message |
FWY Currently Banned New User
Joined: 23 Oct 2006 Posts: 10
|
|
|
|
Would appreciate very much if you could help.
Source code:
001600 WORKING-STORAGE SECTION.
001700 01 VAR1.
001800 49 VAR1-LEN PIC S9(4) USAGE COMP.
001900 49 VAR1-TEXT PIC X(15).
002000 01 VAR2 PIC S9(12) USAGE COMP-3.
002100 01 VAR3 PIC S9(12) USAGE COMP-3.
002200 *----------------------------------------------------------------
002300 *
002400 PROCEDURE DIVISION.
002500 *----------------------------------------------------------------
002600 *
002700 000-MAIN-END.
002800 *-----------------------------------------------------------*
002900 MOVE 6 TO VAR1-LEN
003000 MOVE X'3132333435332' TO VAR1-TEXT
003100 MOVE VAR1-TEXT(1:VAR1-LEN) To VAR2
003200 MOVE VAR2 TO VAR3
003300 STOP RUN.
abend OC7.
IN LINE 003000 , IF WE USE BELOW SENTENCE.
003000 MOVE X'F1F2F3F4F5F6' TO VAR1-TEXT .
that will be fine.
What's the reason?
Please help me on this issue.
Thanks very much. |
|
Back to top |
|
|
FWY Currently Banned New User
Joined: 23 Oct 2006 Posts: 10
|
|
|
|
FWY wrote: |
Would appreciate very much if you could help.
Source code:
001600 WORKING-STORAGE SECTION.
001700 01 VAR1.
001800 49 VAR1-LEN PIC S9(4) USAGE COMP.
001900 49 VAR1-TEXT PIC X(15).
002000 01 VAR2 PIC S9(12) USAGE COMP-3.
002100 01 VAR3 PIC S9(12) USAGE COMP-3.
002200 *----------------------------------------------------------------
002300 *
002400 PROCEDURE DIVISION.
002500 *----------------------------------------------------------------
002600 *
002700 000-MAIN-END.
002800 *-----------------------------------------------------------*
002900 MOVE 6 TO VAR1-LEN
003000 MOVE X'3132333435332' TO VAR1-TEXT
003100 MOVE VAR1-TEXT(1:VAR1-LEN) To VAR2
003200 MOVE VAR2 TO VAR3
003300 STOP RUN.
_________________ In the example,
003000 MOVE X'313233343536' TO VAR1-TEXT
abend OC7.
IN LINE 003000 , IF WE USE BELOW SENTENCE.
003000 MOVE X'F1F2F3F4F5F6' TO VAR1-TEXT .
that will be fine.
What's the reason?
Please help me on this issue.
Thanks very much. |
|
|
Back to top |
|
|
sankar_MF
New User
Joined: 19 Sep 2006 Posts: 29
|
|
|
|
Hi,
The Command you used ( Move X'F1F2F3F4F5F6' ) is a type of Signed Represtation.
In General, X 'sd', where s is a sign representation and d represents the digit. In this case, Move 'X'F1F2F3F4F5F6', F is a Sign and 1,2,3,4,5,6 are digits.
Normally, the sign in the data should be one of the three preferred signs.
Signed Positive or "O" : X 'C'
Signed Negative : X 'D'
Unsigned or Alphanumeric: X 'F'
In the case, X'3132333435332, the value for sign is "3", so it is a invalid one. I think this is the reason for your SOC7.
Thanks
Sankar |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Quote: |
003000 MOVE X'313233343536' TO VAR1-TEXT
abend OC7.
IN LINE 003000 , IF WE USE BELOW SENTENCE.
003000 MOVE X'F1F2F3F4F5F6' TO VAR1-TEXT .
that will be fine.
|
Are you trying to say that your 0c7 occured during that move? I think not! And changing to hex won't alter anything.
Without a little experimenting, I can't be sure of which one but my bet is on the 3200 move. With garbage in var2, the zap to var3 should fail. |
|
Back to top |
|
|
FWY Currently Banned New User
Joined: 23 Oct 2006 Posts: 10
|
|
|
|
William Thompson wrote: |
Quote: |
003000 MOVE X'313233343536' TO VAR1-TEXT
abend OC7.
IN LINE 003000 , IF WE USE BELOW SENTENCE.
003000 MOVE X'F1F2F3F4F5F6' TO VAR1-TEXT .
that will be fine.
|
Are you trying to say that your 0c7 occured during that move? I think not! And changing to hex won't alter anything.
Without a little experimenting, I can't be sure of which one but my bet is on the 3200 move. With garbage in var2, the zap to var3 should fail. |
Hi, Sirs.
Thanks for your reply, i am not meaning that LINE 003000 is causing that abend.
You are right, Sir. yes, 3200 move is causing that abend, could you please explain further that why it is abended.
Appreciate very much. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
You have character data, zoned decimal, in a comp3 data element. IIRC, the move from signed packed field to a signed packed field should compile as a ZAP, zero and add packed, which, again IIRC, should result in a data exception. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi FWY,
You should confine a problem to 1 thread. This is the 3rd thread for the same problem. Using 1 thread maintains the continuity for your problem and makes it easier for us to follow it.
Back to the prob: Sankar is right, you need a valid sign at the end of that HEX string. If you coded the string something like this:
X'0313233343536C' the 0C7 should disappear.
Oh, and move 7 NOT 6 to VAR1-LEN because VAR2 is 7 bytes long. |
|
Back to top |
|
|
muthukannan
New User
Joined: 03 Aug 2006 Posts: 42 Location: Chennai
|
|
|
|
Hi,
For your first post the count of your number which u moved to the variable is not even.
i.e.
The count 3132333435332 is not even.
If the count of your value is not even then move wont work and it will throw error.
Even if its even it won't work.
Let me explain briefly.
The most significant bit is (MSB) = 3
The least significant bit is (LSB) = 1
The result is a unreadable character. That's y its giving error.
For F1
MSB = F
LSB = 1
The result is 1.
Thats the reason why its not giving error for F1.
I think this would clear your doubts.
Let me know if am wrong.
Thank you,
MK |
|
Back to top |
|
|
FWY Currently Banned New User
Joined: 23 Oct 2006 Posts: 10
|
|
|
|
muthukannan wrote: |
Hi,
For your first post the count of your number which u moved to the variable is not even.
i.e.
The count 3132333435332 is not even.
If the count of your value is not even then move wont work and it will throw error.
Even if its even it won't work.
Let me explain briefly.
The most significant bit is (MSB) = 3
The least significant bit is (LSB) = 1
The result is a unreadable character. That's y its giving error.
For F1
MSB = F
LSB = 1
The result is 1.
Thats the reason why its not giving error for F1.
I think this would clear your doubts.
Let me know if am wrong.
Thank you,
MK |
Hi,
Thanks for your help.
I mean X'313233343536' instead of the even num X'3132333435332' .
Thanks. |
|
Back to top |
|
|
|