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

How to avoid NAT3021 error


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
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
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: 2358
Location: Israel

PostPosted: Tue Aug 25, 2009 8:19 pm
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
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: 2358
Location: Israel

PostPosted: Tue Aug 25, 2009 10:35 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts How to avoid duplicating a CICS Web S... CICS 0
No new posts Error while running web tool kit REXX... CLIST & REXX 5
Search our Forums:

Back to Top