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
 

 

Why this S0C4?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Douglas Allen

New User


Joined: 24 Jul 2012
Posts: 10
Location: United States

PostPosted: Sat Mar 22, 2014 9:37 am    Post subject: Why this S0C4?
Reply with quote

Ok, I've been programming COBOL 17 years. I have very little assembler exposure, but I have a situation requiring some assembler code. SO.....

I am moving some data to an area in DSECT OUTREC. I have coded this:

Code:
         USING OUTREC,R11
         LA    R11,OUTREC
         LA    R6,OFIXEDR
         LA    R7,3004
         LR    R8,R3
         LA    R9,3004
         MVCL  R6,R8


And my DSECT is at the bottom of the program:

Code:
OUTREC   DSECT
OFIXEDR  DS    0H
OFXRDW   DS    H
         DC    H'0'
OFIXED   DS    CL3000
ODCTR    DS    CL250


When the program executes the MVCL, I get S0C4. Abendaid gives me nothing. I know it is the MVCL command from using Expeditor. Again, I've been working off of example and reading information on assembler programming from various sources. Thoughts?

Thanks in advance!
Back to top
View user's profile Send private message

steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Sat Mar 22, 2014 10:25 am    Post subject:
Reply with quote

  • Your length registers are set to 3004, but the actual length - at least the length of the target - is 3000.
  • The source address is in reg 3, which you copied to reg 8 before the MVCL. Is reg 3 correct??
  • Look at the registers. What is in registers 7 and 9? Their contents will give you a good idea how far the MVCL progressed before the ABEND.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Sat Mar 22, 2014 12:17 pm    Post subject:
Reply with quote

@steve, 2 halfwords + 3000 = 3004

Your coding should be something like this:

Code:

         load R11 with the adress of storage (getmained)
         USING OUTREC,R11
         LA    R11,OUTREC  remove this statement
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Sat Mar 22, 2014 5:52 pm    Post subject:
Reply with quote

PeterHolland wrote:
@steve, 2 halfwords + 3000 = 3004 ...
Oops - my bad.

If Mr. Holland is correct, then move the actual length
Code:
         LH    7,0(,3)
         LR    9,7

         or

         LH    9,0(,3)
         LA    7,3004
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Sat Mar 22, 2014 10:39 pm    Post subject:
Reply with quote

This problem has nothing to do with lengths, but loading R11 with a DSECT address, and what is that?

And its not IF Mr. Holland is correct,it is OF COURSE.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sun Mar 23, 2014 3:05 am    Post subject: Reply to: Why this S0C4?
Reply with quote

FWIW to Mr. Allen, if the length exceeds 4095, you'll get an Assembly failure. Instead of a LA, use a LHI (Load Halfword Immediate), which has a maximum of 32767 and you'll be golden, unless the length exceeds 32767.

I've yet to find a Load Fullword Immediate in the POPS manual, then you could substitute this for both a LA and LHI.

The L' could also come in handy -

Code:

         LHI   R7,L'OFIXED+4
         LR    R9,R7

Or as Steve has posted (and this is a variable-length DSECT) -

Code:

         LH    R7,0(,R3)

HTH....
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Sun Mar 23, 2014 5:20 am    Post subject: Re: Reply to: Why this S0C4?
Reply with quote

Bill O'Boyle wrote:
FWIW to Mr. Allen, if the length exceeds 4095, you'll get an Assembly failure. Instead of a LA, use a LHI (Load Halfword Immediate), which has a maximum of 32767 and you'll be golden, unless the length exceeds 32767.

I've yet to find a Load Fullword Immediate in the POPS manual, then you could substitute this for both a LA and LHI.

The L' could also come in handy -

Code:

         LHI   R7,L'OFIXED+4
         LR    R9,R7

Or as Steve has posted (and this is a variable-length DSECT) -

Code:

         LH    R7,0(,R3)

HTH....
  • L'OFIXED = 2
  • L reg,=A(length-value)
  • We don't really know what reg 3 is pointing to. It seems to me the odds are it is a record read by a locate mode GET macro:
    Code:
             GET   dcb
             LR    3,1
    You see exactly that quite often in my code.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Sun Mar 23, 2014 1:49 pm    Post subject:
Reply with quote

Bill and steve, OUTREC has a length of 3004. Nothing variable here. But the TS does a LA of a DSECT in R11, so R11 will contain zero.
As far as I see it this will give a nice S0C4.

By the way loading a register with a fullword will bypass the 32767 limit.

And it would be nice if the TS showed some more code, so steve's question about R3 could be solved.
Back to top
View user's profile Send private message
Muralidhara V

New User


Joined: 10 Apr 2014
Posts: 1
Location: India

PostPosted: Fri Apr 18, 2014 12:32 am    Post subject:
Reply with quote

Hey Douglas,

MVCL R6,R8

This instruction moves data from the address pointed by R8 to the address pointed by R6. The values in R7 and R9 indicate the destination and source lengths respectively.

In this case, R6 doesn't seem to have a a proper virtual address.

LA R6,OFIXEDR will not load a proper address into R6. Because DSECT doesn't have a physical memory like any other working storage variables outside DSECT. The DSECTs are just the layouts without virtual storage allocated.

SOC4 occurs when we try to manipulate any part of the address space not available to user program. In this case, I guess R6 has 0, which is obviously the core system area of the address space, which your program should never manipulate.

Solution : GETMAIN a virtual storage of 3004 bytes (or a little more). Code the required parameter to get the allocated address directly into R6 (Please refer the syntax of GETMAIN for the same). Then code the following

USING OUTREC,R6 ** Map the address in R6 with a layout
LA R7,3004 ** Load destination length
LR R8,R3 ** Load source address
LR R9,R7 ** Load source length. Using LR as source length == Dest. length
MVCL R6,R8 ** Now move


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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Getting S0C4 while running COBOL Data... kalakuntlavenkat COBOL Programming 4 Thu Feb 26, 2015 8:48 pm
No new posts Getting S0C4 when Writing a Record thesumitk COBOL Programming 7 Wed Feb 04, 2015 3:26 pm
No new posts S0C4 error, ISPF processor ended abno... Raghu navaikulam ABENDS & Debugging 5 Wed Dec 17, 2014 2:55 pm
No new posts S0C4 Abend in Stored Procedure rahuindo DB2 7 Tue Sep 16, 2014 7:04 pm
No new posts S0C4 reason code 10, gets when more c... bhushan.shete PL/I & Assembler 2 Mon Jul 07, 2014 4:36 pm


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