Natural CPU Usage

We have a lot of Assembler routines in our installation. These routines are called by Natural in batch mode and Natural under CICS.
Recently I compared the cpu usage from both methods:
a) for the first case, Natural batch calling an Assembler routine, the cpu usage is ok;
b) for the second, Natural under CICS calling an Assembler routine, the cpu usage is extremely high. In some cases, a Natural subprogram uses less cpu than

Are the rutines in batch also dynamic loaded? If not you are comparing apples and bananas. :slight_smile:

I they both are dynamic loaded it could be CICS that is expensive in terms of cpu in loading these rutines.

Given that, why would you think there was a Natural fault? Natural performs the standard CICS linkage that every CICS application is burdened with. Natural is able to provide you with a high-performance alternative that a standard CICS linkage cannot match.

In any case, verify that your AMODE/RMODE options are compatible - the less mode switching involved, the better. If LE is involved, be sure that all sides of the call are aware of the LE enclave (setting the Natural LE option appropriately).

Does the %P=SC option work for your environment?

First of all, thanks Douglas and Mogens for your quick response.
I’d like to say that I’m using dynamic load and standard linkage convention for both situations: batch and under CICS execution.

This afternoon, I did some tests trying to understand and justify why I think there is a Natural fault. I did a new Assembler routine with AMODE/RMODE compatible with Natural nuclei and run this one in batch mode and under CICS. I also called the same Assembler routine from a Cobol application in batch mode and under CICS.
The results of the test, in terms of cpu usage, were as follows:

Cobol batch: 0.15 secs
Cobol under CICS: 0.15 secs

Natural batch: 0.40 secs
Natural under CICS: 5.25 secs (0,40 secs with RCA=routine)

Then, I discarded the possibility of the expensive loads being caused by CICS because there was no difference between the batch and online executions when started from a Cobol main program.
I also tried to use %P=S, but there was no difference on results.

As it could be observed above, when RCA parameter was specified for Natural under CICS, the time spent on execution were the same for batch and online mode. May I always use this parameter for all Assembler routines?? I ask this because Software AG doesn’t recommend the use of RCA=ON, as it could be seen on the Natural Installation Manual.

from the documentation on parameters:

It is available and usable, but you will need to measure your startup time in your environment to see the impact of RCA=ON.

However, the use of RCA=(program,program,etc) is an alternative that reduces this startup overhead as it will only look for the programs in this list, not everything in the list of static non-Natural programs.

I’m curious: did your COBOL program calling the assembler routine in CICS use a “CALL” statement or an “EXEC CICS LINK” statement to call the assembler routine? Natural’s standard linkage in CICS uses the “EXEC CICS LINK” option, whereas the RCA/CSTATIC approach uses OS standard linkage (BALR 14,15).

Also note that the %P=SC option bypasses the EXEC CICS LINK call, using stanard linkage conventions, but using EXEC CICS conventions for parameter passing. This might also reduce your overhead.

The use of RCA=(routine,…) is a bit difficult to use in our installation, because it’s difficult to know which routines each program will execute. It varies for each execution of the same program. This is true specially for our proprietary solution, that uses Cics Web Support to access Natural on mainframe from other platforms. In fact, RCA=ON would be the worst option.

Then, to avoid the overhead of RCA, I decided to link all the routines with the Natural nuclei. They are low maintenance routines so I believe this is the best solution for us.

Anyway, I think %P=SC is a Natural 4 enhancement, isn’t it? I’m using Natural 3.1.6 yet.

Cobol doesn’t use “EXEC CICS LINK”, but a “CALL” statement to call an assembler routine. I think Natural under CICS could use a similar way to call assembler routines to improve its performance.

ok, well so far you’ve demonstrated that it is not a Natural issue! Using the RCA option and static link (CSTATIC) options ask Natural to use the standard linkage (non-CICS) convention, which would be comparable to using a CALL statement from COBOL.

COBOL can use the EXEC CICS LINK option to call assembler routines as long as the assembler routines can follow the EXEC CICS LINK parameter passing conventions. It would be unusual (but possible I think) for the same load module to be able to use both calling conventions - depending on how this was done, it could add to the overhead of using the EXEC CICS LINK call.

If %P=S is used, it must be issued before every CALL that needs it - it is not a toggle setting.