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 

HLASM - linkage,S0C4, wto help required

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
sontoo
Beginner


Joined: 11 Jun 2010
Posts: 2
Topics: 1

PostPosted: Fri Jun 11, 2010 12:26 pm    Post subject: HLASM - linkage,S0C4, wto help required Reply with quote

Hi,

I am new to assembler.

Please help with the following points:
1. I am trying to call an assembler prog PROGB from a COBOL prog PROGA.

In PROGA
Code:

CALL PROGB USING WS-PARMDATA
END-CALL

WS-PARMDATA is defined as pic x(10) in working storage.

In PROGB
Code:

PROGB    CSECT             
         STM   14,12,12(13)
         BALR  12,0         
         USING *,12         
         ST    13,SAVE+4   
         LA    13,SAVE     
         WTO  'START PROGB'
         L     2,0(1)       
         USING PARMDATA,2   
EXIT     L  13,SAVE+4   
         LM    14,12,12(13)
         BR    14           
         WTOR  'END PROGB'
SAVE     DS    18F         
PARMDATA DS    CL10         
         END PROGB         

Just trying to set the addressabilty of the passed parameter but it is abending with a S0C4 when trying to execute L 2,0(1).

How can I correct this or what is the correct way to pass a parameter to an assembler routine?

2. Can I use WTO to display the value of a variable? If not is there any other way this can be done.
Back to top
View user's profile Send private message
sontoo
Beginner


Joined: 11 Jun 2010
Posts: 2
Topics: 1

PostPosted: Sun Jun 13, 2010 5:57 am    Post subject: Reply with quote

Hi All,

Could anyone please help with the error.

Will introducing s DSECT help as shown below:

.
.
SAVE DS 18F
PARMDATA DSECT
PARMFLD1 DS CL10
END PROGB
Back to top
View user's profile Send private message
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Sun Jun 13, 2010 9:55 am    Post subject: Reply with quote

If I were you, I would add ',ROUTCDE=11' to the first WTO, as without a ROUTCDE it's possible that the default is a routing code which you are not authorized to use, or which will bring other unintended consequences. ROUTCDE=11 will direct the WTO to your program log ( JESYSMSG ) dataset.

That being said, it is also possible that the SOC4 is a result of assembling/linking PROGB with AMODE=24 instead of AMODE=31, in which case addressability in PROGB could be the issue.

On another note: the final WTOR ( 'END PROGB') is wrong on two accounts:

1) WTOR is a write with a request for a Response ( typically from the console operator ) and could result in an automatic or operator initiated response that you will not appreciate.

2) Coding ANY instructions following the EXIT routine's 'BR 14' is a waste of time, since the program will have been exited before those instructions could possibly have been executed. If you want to issue a WTO for the exit message, it must be done BEFORE the 'L 13,SAVE+4' instruction ( and make it a WTO not a WTOR, and add 'ROUTCDE=11 ).
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
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 -> Application Programming 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