View previous topic :: View next topic
|
Author |
Message |
DS Warnings : 1 New User
Joined: 09 Jun 2005 Posts: 25 Location: Bangalore
|
|
|
|
Hi,
I am calling COBOL pgm from DB2 stored procedure. COBOL program should INSERT a row in DB2 table and later the same data has to be inserted in IMS database into a segment.
My program is compiled and binded successfully but not running. Its giving SOC4 error some times. When I try to Xpedite the program its giving Abend S806-04. I need some clarifications.
1. In what mode should I use for debugging? standard / IMS / MPP / BMP?
2. How to run this program?
3. Is there any standard compile JCL?
I have written a sample program with a INPUT file reading and INSERTin in to DB2 table. Up to this its working fine, afterwards I added IMS part. Its compiling good but not running properly. Appreciate any help in this regard.
Thanks & Regards,
DS. |
|
Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
When you have a question, you need to start a new topic for your question rather than reply to some existing topic. |
|
Back to top |
|
 |
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Did you do a PSB? |
|
Back to top |
|
 |
DS Warnings : 1 New User
Joined: 09 Jun 2005 Posts: 25 Location: Bangalore
|
|
|
|
Hi,
I do have a PSB. But I am trying schedule a PSB using 'AERTDLI' call.
When I try to initialize, its giving AIBRETRN code 260.
AIBRETRN is part of AIB declaration. Here is the brief about concept.
Java Cleint --> Calling DB2 stored proc --> calling COBOL program --> COBOL program first insert a row into DB2 table --> Next same data of row should be inserted into IMS segment.
I am trying to work IMS ODBA access to connect IMS databse from DB2 stored proc.
COBOL program name: COBOLTST
PSB Name: TSTPSB
PCB Name: TSTPCB60
----------------------------------------
WORKING-STORAGE SECTION.
01 PGM-COBOLTST PIC X(08) VALUE 'COBOLTST'.
.......
.......
***********************************************************
* DL/I FUNCTION CODES
***********************************************************
77 GET-UNIQUE PICTURE X(4) VALUE 'GU '.
77 GET-HOLD-UNIQUE PICTURE X(4) VALUE 'GHU '.
77 GET-NEXT PICTURE X(4) VALUE 'GN '.
77 GET-HOLD-NEXT PICTURE X(4) VALUE 'GHN '.
77 DLET PICTURE X(4) VALUE 'DLET'.
77 ISRT PICTURE X(04) VALUE 'ISRT'.
77 REPL PICTURE X(04) VALUE 'REPL'.
77 CIMS PIC X(04) VALUE 'CIMS'.
77 APSB PIC X(04) VALUE 'APSB'.
77 DPSB PIC X(04) VALUE 'DPSB'.
77 APSB-NAME PIC X(08) VALUE 'TSTPSB'.
77 DPCB-NAME PIC X(08) VALUE 'TSTPCB60'.
77 APPLNME2 PIC X(08) VALUE 'DFSTDB2P'.
77 VAIBID PIC X(08) VALUE 'DFSAIB '.
77 TDBCTLID PIC X(08) VALUE 'IMSG '.
77 TDBCTLALL PIC X(08) VALUE 'ALL '.
.......
.......
LINKAGE SECTION.
01 PARM1-CD-IN PIC X(05).
01 PARM2-ID-NBR-IN PIC X(07).
01 PARM3-CD-IN PIC X(07).
01 OUT-AIBRETRN PIC 9(09) USAGE BINARY.
01 OUT-AIBREASN PIC 9(09) USAGE BINARY.
01 SQL-RETURN-CD-OUT PIC S9(09) COMP.
01 SQL-ERRMSG-OUT.
49 SQL-ERRMSG-OUT-LEN PIC S9(04) COMP.
49 SQL-ERRMSG-OUT-TEXT PIC X(255).
01 DBPCB.
02 DBNAME PICTURE X(8).
02 SEG-LEVEL-NO PICTURE X(2).
02 DBSTATUS PICTURE XX.
02 FILLER PICTURE X(20).
********************************************
PROCEDURE DIVISION USING
PARM1-CD-IN
PARM2-ID-NBR-IN
PARM3-CD-IN
SQL-RETURN-CD-OUT
SQL-ERRMSG-OUT.
.......
.......
**********************************************
* A1100-INITIALIZE
**********************************************
A1100-INITIALIZE.
INITIALIZE AIB.
SET AIBRESA1 TO NULLS.
SET AIBRESA2 TO NULLS.
SET AIBRESA3 TO NULLS.
MOVE ZEROES TO AIBRETRN.
MOVE ZEROES TO AIBREASN.
MOVE VAIBID TO AIBID.
MOVE LENGTH OF AIB TO AIBLEN.
*DS MOVE LENGTH OF IOAREA
MOVE LENGTH OF TST02P-DB-TST0201-SEG-ROOT TO AIBOALEN.
MOVE SPACES TO AIBSFUNC.
*DS MOVE APSBNME TO AIBRSNM1.
MOVE APSB-NAME TO AIBRSNM1.
MOVE TDBCTLID TO AIBRSNM2.
CALL 'AERTDLI' USING APSB, AIB.
IF AIBRETRN NOT EQUAL ZEROES
MOVE AIBRETRN TO OUT-AIBRETRN
MOVE AIBREASN TO OUT-AIBREASN
*DS MOVE ZEROES TO PSQLCODE
MOVE ZEROES TO SQL-RETURN-CD-OUT
........
........
Tricky thing here is PGM-NAME is not same as PSB-NAME. Next no ENTRY statement NOR IMS IO-PCB, ALT-PCB, DB-PCB in PROCEDURE DIVISION and as well in LINKAGE SECTION. Only IN and OUT paramers and one DB-PCB.
First to schedule a PSB we're using APSB call then trying to INSERT/UPDATE data into IMS databse.
Here I am getting AIBRETRN code as 260 and if I try to go further its encouter SOC4 abend.
Appreciate any idea.
Thanks & Regards,
DS. |
|
Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello DS,
Please re-post your question about 'AERTDLI' - i deleted it by mistake. |
|
Back to top |
|
 |
Vinay Srivastava
New User
Joined: 03 Dec 2011 Posts: 1 Location: INDIA
|
|
Back to top |
|
 |
CyberKing
New User
Joined: 13 Sep 2007 Posts: 7 Location: Victoria,BC,Canada
|
|
|
|
That's true!
You need printing both the return code and reason code ( in decimal) . then lookup the manual can easily find the issue.
FYI: I've successfully implemented ODBA in PL/I however, it can access both IMS DB and DB2. |
|
Back to top |
|
 |
|