How can I determine the active version of Natural?

I am writing an Assembler routine that will run as an extension to selected Natural programs in batch and under CICS. These Natural programs will be running on several systems under various version of Natural.

In order to perform my tasks I need to identify the version of Natural I am running in.

I can locate the IOCB control block that is mapped by the macro NAMIOCB
This contains a field TPDRIVL that seems to contain the Natural level in zoned numeric characters eg ‘4203’ on my 4.23 system.
TPDRIVL DS 0CL4 P (INTP) DRIVER INTERFACE LEVEL

Is there any more reliable way of identifying the version of Natural that is running?

The SYSPROD command will tell you the version of all of the Natural products.

Is *NATVERS too simple ? :wink:

As I say, I am running within an assembler-written extension to Natural programs. As far as I know I don’t have any ability to issue Natural commands or interrogate Natural variables. :frowning:

I am looking for a release-independant way of identifying the version of Natural that is running

By navigating system control blocks I can locate the IOCB which contains the field TPDRIVL eg ‘4203’ on my version 4.2.3.
But this is located at offset X’13C’ which may not be the case in other versions, and therefore does not seem to be very reliable.
By scanning the names of active programs I can see that load modules NAT423BA & NAT423SH are active. But that may not be the case in all situations for that version.
Any suggestions gratefully accepted.

Is it unacceptable to have the CALL pass the version as an argument? Then, as Wolfgang suggested, you could use *NATVERS.

steve

This code is part of a debug/monitor facility. It will not usually be ‘CALL-ed’ from within the Natural program it is watching. So I cannot use Natural variables or facilities.
I need to orient myself using the system control blocks, and try to identify the version from what I can see.
The IOCB on my systems contains a version string at +13C:
TPDRIVL DS 0CL4 P C’4203’
This is echoed in the BB/CRAB at +210:
BBZAPLV DS CL4
Both of these fields are at arbitrary-looking offsets which may change from version to version, making the process of identifying the version more difficult.