Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Cobol OC7 ABEND.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
View previous topic :: :: View next topic  
Author Message
FWY
Currently Banned

New User


Joined: 23 Oct 2006
Posts: 10

PostPosted: Fri Dec 08, 2006 6:27 am    Post subject: Cobol OC7 ABEND.
Reply with quote

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
View user's profile Send private message

FWY
Currently Banned

New User


Joined: 23 Oct 2006
Posts: 10

PostPosted: Fri Dec 08, 2006 6:33 am    Post subject: Re: Cobol OC7 ABEND.
Reply with quote

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
View user's profile Send private message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Fri Dec 08, 2006 2:40 pm    Post subject:
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Dec 08, 2006 5:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
FWY
Currently Banned

New User


Joined: 23 Oct 2006
Posts: 10

PostPosted: Fri Dec 08, 2006 7:42 pm    Post subject:
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Dec 08, 2006 7:51 pm    Post subject:
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Dec 10, 2006 5:34 am    Post subject:
Reply with quote

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
View user's profile Send private message
muthukannan

New User


Joined: 03 Aug 2006
Posts: 42
Location: Chennai

PostPosted: Mon Dec 11, 2006 8:38 am    Post subject: Re: Cobol OC7 ABEND.
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
FWY
Currently Banned

New User


Joined: 23 Oct 2006
Posts: 10

PostPosted: Wed Dec 13, 2006 6:49 am    Post subject: Re: Cobol OC7 ABEND.
Reply with quote

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 icon_smile.gif




Hi,
Thanks for your help.
I mean X'313233343536' instead of the even num X'3132333435332' .
Thanks.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us