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: 1533

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: 49
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: 1533

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 Concurrent writing records to VSAM fr... JCL & VSAM 9
No new posts Passing parm from JCL to Assembler, b... PL/I & Assembler 2
No new posts COBOL Program to search for five digi... COBOL Programming 4
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts Assembler class assignment: stuck on ... PL/I & Assembler 12
Search our Forums:

Back to Top