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
 

 

How to avoid NAT3021 error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
karthick.gupta

New User


Joined: 03 Nov 2008
Posts: 2
Location: LONDON

PostPosted: Tue Aug 25, 2009 5:14 pm    Post subject: How to avoid NAT3021 error
Reply with quote

We have a Natural code in which we call a Cobol code.

Natural Code:
=========
Read Adabas-File1
Call Cobol-Code
Update (Adabas-File1)
End read

Cobol Code:
========
Perform Read Adabas-File2
Call MQ Push
Commit
DB Close
End perform

When the Cobol code is called inside the read loop of natural code, we are getting then NAT3021 error.
I believe this is because the once DBclose is issue in Cobol the next read pointer is not available in Natural and resulting in NAT3021.

So can some please advise how can we handle this situation.
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Aug 25, 2009 8:19 pm    Post subject:
Reply with quote

ADABAS response 21 (interpreted as Natural error 3021) means that your command id was lost somehow.

Since you didn't provide any details regarding the method you call ADABAS from COBOL, I assume you are using direct ADABAS calls. If this is the case, simply remove the CL (close) command from your COBOL program. Just for you to know, a CL command releases all command-id's associated with the user and also issues an implicit END TRANSACTION.

Alternative methods would include saving the command-id in your Natural program (which is not that simple) and restoring it upon return from COBOL.

O.
Back to top
View user's profile Send private message
karthick.gupta

New User


Joined: 03 Nov 2008
Posts: 2
Location: LONDON

PostPosted: Tue Aug 25, 2009 8:38 pm    Post subject: Reply to: How to avoid NAT3021 error
Reply with quote

Thanks for the reply,

It is a direct/simple adabas call.

The same cobol module is called from Natural codes and also by real time CICS transactions, so we have to use CL command to relase command id's, other wise the resources will not be released when this cobol called by CICS transaction.

So we would like to know how we can save the command id and restore it in natural upon return from Cobol.

Can you please advise how/any reference materail/will it effect the performance?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Aug 25, 2009 10:35 pm    Post subject:
Reply with quote

When using modular database infrastructure, it is highly accepted to put the access commands in one module, while ET, BT, OP & CL should be in separate module(s).

My advice to you is to remove the CL from your cobol program. You can either:
1. Issue the CL from your CICS transaction.
or
2. Issue the CL conditionally (that is - only when not called from Natural).

Messing with command id's is strongly not recommended.

O.
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 -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm


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