# Natural calling z/OS assembler

**URL:** <https://techcommunity.softwareag.com/t/natural-calling-z-os-assembler/101084>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes, Natural-Database-and-TP-Monitor-Interfaces-on-Mainframes\
**Created:** [July 26, 2012, 4:44pm UTC](https://techcommunity.softwareag.com/t/natural-calling-z-os-assembler/101084 "2012-07-26T16:44:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerhard\_Weinhold](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Gerhard\_Weinhold](https://techcommunity.softwareag.com/u/Gerhard_Weinhold)\
**Post date:** [July 26, 2012, 4:44pm UTC](https://techcommunity.softwareag.com/t/natural-calling-z-os-assembler/101084/1 "2012-07-26T16:44:08Z")

</div>

Are there any limits to MVS system services available to an assembler subroutine called from a Natural program? For example, it would LOAD programs into memory and save their load point for subsequent use (using name/token), create and access dataspace(s), do I/O to sequential files, invoke a PC to set an MVS RESMGR end of task exit.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [July 26, 2012, 4:54pm UTC](https://techcommunity.softwareag.com/t/natural-calling-z-os-assembler/101084/2 "2012-07-26T16:54:49Z")

</div>

Well, Natural doesn’t limit you here, i.e. it doesn’t set up a FLIH / SVC screening or the like,  
but as I guess you are aware most of the services you have in mind are authorized, which  
isn’t an issue as long as you are running authorized.

Are we talking about plain Natural batch, or some sort of multi user environment ?

---

<div class="post-metadata">

**Author:** ![Gerhard\_Weinhold](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Gerhard\_Weinhold](https://techcommunity.softwareag.com/u/Gerhard_Weinhold)\
**Post date:** [July 26, 2012, 5:16pm UTC](https://techcommunity.softwareag.com/t/natural-calling-z-os-assembler/101084/3 "2012-07-26T17:16:10Z")

</div>

Actually I was think of the cases when it would be called from a Natural program in under a transaction manager. The code wouldn’t be authorized, but it would issue user PC’s (instead of user SVCs) to execute authorized services.

When under Com-plete, will I be able to rely on the entry point of my loaded modules staying the same (or does it do load module management like IMS/TM) ? Is there any technique to acquire memory that will last for the life of the transaction or will the calling Natural program have to manage that?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [July 26, 2012, 5:50pm UTC](https://techcommunity.softwareag.com/t/natural-calling-z-os-assembler/101084/4 "2012-07-26T17:50:11Z")

</div>

By coincidence I’ve done something along these lines around Natural under COM-PLETE a while ago 😉

What I’ve done is create a server used for authentication, it’s called via PC from within COM-PLETE,  
so yes, that works.

The main question here is the scope of the storage you’d like to acquire, is it local to the session,  
or global to the whole environment (read: COM-PLETE address space) ?

Re. “rely on the entry point to stay the same” - look at RESIDENTPAGE programs, they are loaded  
into the COM-PLETE address space rather than the thread, and the EP will stay the same, but it’ll  
have to be reentrant - any problem with this ?

---

<div class="post-metadata">

**Author:** ![Gerhard\_Weinhold](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Gerhard\_Weinhold](https://techcommunity.softwareag.com/u/Gerhard_Weinhold)\
**Post date:** [July 26, 2012, 6:31pm UTC](https://techcommunity.softwareag.com/t/natural-calling-z-os-assembler/101084/5 "2012-07-26T18:31:53Z")

</div>

Thanks, it sounds like this can work.

Most of the storage acquired is for the life of the address-space and would be anchored in the name/token, but some is local to the transaction/session (I assume a session is conceptually the same as a CICS transaction) since the subroutine can be called more than once per transaction and a scratchpad area is more efficient than acquiring storage each time (but there will have to be a mechanism to release it at end of session).

It sounds like RESIDENTPAGE is just what is needed for the programs (yes, all programs are/will be reentrant).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [July 26, 2012, 7:13pm UTC](https://techcommunity.softwareag.com/t/natural-calling-z-os-assembler/101084/6 "2012-07-26T19:13:08Z")

</div>

Well, there’s a “transaction” in COM-PLETE as well, there are differences as all transactions  
in COM-PLETE are conversational, your application (e.g. Natural) runs in a thread, so any  
storage acquired within the thread is there to stay, and you will not even have to release  
it explicitly at “end of transaction”.

One thing to watch out, though - you mentioned “IO to sequential files”, remember you are  
in a multi-user environment, if this is just to pick up control information at startup that shouldn’t  
be a problem, but otherwise you’ll probably hit concurrency issues.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:02pm UTC](https://techcommunity.softwareag.com/t/natural-calling-z-os-assembler/101084/7 "2021-04-02T15:02:13Z")

</div>


