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
 

 

IMS/DB2/COBOL Insert question

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
View previous topic :: :: View next topic  
Author Message
DS
Warnings : 1

New User


Joined: 09 Jun 2005
Posts: 24
Location: Bangalore

PostPosted: Tue Aug 26, 2008 4:12 am    Post subject: Reply to: Need AIBRETRN value for end of IMS-DB in AERTDLI c
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 26, 2008 4:49 am    Post subject:
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Tue Aug 26, 2008 7:58 pm    Post subject:
Reply with quote

Did you do a PSB?
Back to top
View user's profile Send private message
DS
Warnings : 1

New User


Joined: 09 Jun 2005
Posts: 24
Location: Bangalore

PostPosted: Wed Aug 27, 2008 10:43 pm    Post subject: Reply to: IMS/DB2/COBOL Insert question
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Sep 05, 2008 6:00 am    Post subject:
Reply with quote

Hello DS,

Please re-post your question about 'AERTDLI' - i deleted it by mistake.
Back to top
View user's profile Send private message
Vinay Srivastava

New User


Joined: 03 Dec 2011
Posts: 1
Location: INDIA

PostPosted: Sat Dec 03, 2011 12:23 pm    Post subject: Reply to: IMS/DB2/COBOL Insert question
Reply with quote

Hi,

You are printing the Return code , try printing the reason code as well
for both return code and reason code combinations there are explanations
given in the below book.

Messages and Codes, Volume 4: IMS Component Codes

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.imsmsgs.doc.msgs/dfsmc4h7.pdf?noframes=true

Hope that helps!
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 -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am


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