IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Getting SOC4 while calling a Cobol DB2 Pgm from Assembler


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rajshekhar

New User


Joined: 30 May 2022
Posts: 2
Location: India

PostPosted: Mon May 30, 2022 5:57 pm
Reply with quote

Hello Team,

I am trying to call a new Cobol Db2 program from an existing Assembler program using Dynamic call. I am getting SOC4 abend(Protection exception) during run time.
Tried various combinations compile parameters to compile the new cobol DB2 but getting SOC4.
My Assembler program has many existing calls to other cobol programs and they are working fine. I compiled my existing cobol program with my compile JCL and existing pgm also giving SOC4.. I am using Registers R14 and R15 while calling the new Cobol DB2 pgm..
Could you please let me know how to resolve this abend.

Below are some of the compile parameters I used while compiling my new Cobol DB2 program

COPTS='LIB,RENT,DATA(31),OFFSET,MAP,TERM,DYNAM',
LOPTS='LIST,AMODE=31,MAP,LET,RENT,DYNAM(DLL),RMODE=ANY
SSrange, notest, nooffset and Reus
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Mon May 30, 2022 6:37 pm
Reply with quote

Besides “using registers 15 and 14” you need also to pass the correct R1, to pass parameter exactly as it is expected by COBOL program.

Did you test your COBOL program without calling it from Assemble, - using normal JCL as // EXEC PGM=cobolpgm ?
Back to top
View user's profile Send private message
Rajshekhar

New User


Joined: 30 May 2022
Posts: 2
Location: India

PostPosted: Tue May 31, 2022 9:27 pm
Reply with quote

Thanks for your reply..
yes I tried executing my new Cobol DB2 program directly from JCL and its working fine.

When I call it via Assembler program, it abends at the entry point of Cobol itself with Memory protection exception.

tried various combinations of AMODE and RMODE values but no luck.
Back to top
View user's profile Send private message
hankoerlemans

New User


Joined: 25 Jan 2018
Posts: 61
Location: Australia

PostPosted: Wed Jun 01, 2022 10:56 am
Reply with quote

Can I sell you a debugger ? :-)

Sergey gave you a clue. What is R1 pointing to ?
Did you generate a SYSMDUMP ?
If so IPCS can help if you don't have anything more sophisticated.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Wed Jun 01, 2022 6:00 pm
Reply with quote

Passing R1 to simulate standard JCL PARM= field has nothing to do with “playing with AMODE, an RMODE”, unless you are using different addressing modes in two of your programs.

Please, RTFM about simulation of PARM= string when calling from Assembler. Even when no PARM is used, an empty string MUST be simulated.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Need help with ADABAS query (COBOL-AD... All Other Mainframe Topics 0
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts Compile Sp Cobol base COBOL Programming 1
No new posts SQLCODE=-311 in Cobol SP-DB2. COBOL Programming 2
No new posts COBOL 6.4 - User Defined Function nee... COBOL Programming 6
Search our Forums:

Back to Top