View previous topic :: View next topic
|
Author |
Message |
karthick.gupta
New User
Joined: 03 Nov 2008 Posts: 2 Location: LONDON
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
karthick.gupta
New User
Joined: 03 Nov 2008 Posts: 2 Location: LONDON
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
|