MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Solution to solve SOC4

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Problem Determination
View previous topic :: View next topic  
Author Message
gupta
Beginner


Joined: 12 Feb 2005
Posts: 27
Topics: 15

PostPosted: Sat Feb 12, 2005 11:42 pm    Post subject: Solution to solve SOC4 Reply with quote

Hi List,

I am facing SOC4 abend in my program.
I was able to determine the statement which caused the error with the help of offest as explained in one of the post. But not able to determine the actual cause (Compilation problem/Length problem/Data problem). Can any one guide me to rectify the abend.

The statement that cause the abend is

MOVE DATA-AREA TO WS-DATA-AREA

LINKAGE SECTION.
01 WS-DATA-AREA PIC X(24576).


The compilation option are
RMODE=ANY and AMODE=31 and DATA=31


Thanks
Back to top
View user's profile Send private message
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Sun Feb 13, 2005 7:57 pm    Post subject: Reply with quote

Well, there are probably several posibilities. However from the scant information that you have provided I guess the first thing that I would advise that you check is the length definition of WS-DATA-AREA. If you have a mismatch in this defintion between the caller and the called routine, that could cause a S0C4.

.
________
Fiesta RS Turbo


Last edited by dtf on Tue Feb 01, 2011 1:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
gupta
Beginner


Joined: 12 Feb 2005
Posts: 27
Topics: 15

PostPosted: Mon Feb 14, 2005 12:45 am    Post subject: Reply with quote

dtf,

I have a clarification regarding the length of DATA-AREA.
It's been declared as X(24576), but it varies i.e. somtime it will contain
24576 bytes of data or less than that. Whether this might cause the problem.




Thanks
Back to top
View user's profile Send private message
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Mon Feb 14, 2005 10:52 am    Post subject: Reply with quote

What the area contains will not matter. What the defined length certainly could. When you call a program and pass a linkage area, you are passing an address.

Lets assume an extreame case.........

Caller defines

01 PASSED-FIELD PIC X.

Called defines:

01 WORK-FIELD PIC X(32000).
LINKAGE SECTION.
01 PASSED-FIELD PIC X(32000).
.
.
MOVE WORK-FIELD TO PASSED-FIELD



Back in the calling program, the area starting with address defined at PASSED-FIELD for 32000 bytes is going to get overlayed. Any number of things can happen at this point. If this area extends outside of storage owned by your task, you'd get a S0C4. If the area is still within your program, but the storage contains instructions that you later attempt to execute, you'd probably get a S0C1. In other cases, if you never reference this area, you might not abend at all, and/or you might get unpredictable results since you overlayed other storage and corrupted values.

Finally, in a very bizarre set of circumstances, I have seen something happen in a CICS environment which took me quite a while to debug.

What was occuring, was that a MOVE statment was actually failing intermitantly. This involved the MOVE of DFHCOMMAREA. I traced the failure to the fact that the lengths were defined differently between the LINK "from" and LINK "to" programs. Since this was a 32k move, the COBOL compiler generated an Assembler MVCL. Because of the way storage was being allocated, and the difference in the way the fields were defined, what resulted was that the two fields based upon their ADDRESS and LENGTH would have overlapped.

MVCL will not execute if the fields overlap. Since COBOL has no provision for checking this condition the move would either execute or fail depending on where storage was allocated by CICS. To make matters worse, the debugging tool that I was using at the time "INTERTEST" masked the problem all together.

Bottom line is that you need to be very careful about definitions of passed parameters.

DTF

Another thing I just thought of that you should check, is that your procedure division statement (or entry statement) contains a USING for the passed PARAMETER. I don't know if the compiler would give you an error or not, but if it doesn't and you tried to move something to a linkage field without having specified a USING, then you would have an adressability problem.
________
Tornado engine


Last edited by dtf on Tue Feb 01, 2011 1:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
gupta
Beginner


Joined: 12 Feb 2005
Posts: 27
Topics: 15

PostPosted: Thu Feb 17, 2005 11:05 am    Post subject: Reply with quote

Hi Dtf,

Thanks for your informations, but unfortunatly for me the length was
same.
I encounterd a strange thing, when we moved the code from ACT to
System testing region we are not encountering the error.
can you please share any information regarding this.


Thnaks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Problem Determination All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group