Discussion:
Create subtask w/out a load module?
(too old to reply)
Thomas David Rivers
2017-08-26 02:41:35 UTC
Permalink
Raw Message
The ATTACH (or ATTACHX) macro is used to create
a subtask - but it requires (basically) a separate
load module...

Is there a mechanism to create a subtask within
the currently loaded load-module?

- Thanks -
- Dave R. -
--
***@dignus.com Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com
Barry Schwarz
2017-08-26 04:06:46 UTC
Permalink
Raw Message
On Fri, 25 Aug 2017 22:41:35 -0400, Thomas David Rivers
Post by Thomas David Rivers
The ATTACH (or ATTACHX) macro is used to create
a subtask - but it requires (basically) a separate
load module...
Is there a mechanism to create a subtask within
the currently loaded load-module?
You can specify the entry address using the EPLOC operand.
--
Remove del for email
Thomas David Rivers
2017-08-26 09:35:00 UTC
Permalink
Raw Message
Post by Barry Schwarz
On Fri, 25 Aug 2017 22:41:35 -0400, Thomas David Rivers
Post by Thomas David Rivers
The ATTACH (or ATTACHX) macro is used to create
a subtask - but it requires (basically) a separate
load module...
Is there a mechanism to create a subtask within
the currently loaded load-module?
You can specify the entry address using the EPLOC operand.
Hi Barry!

Thanks for the pointer! But I think EPLOC specifies
the address of the name.. the name is still an 8-byte load
module name...

From the ATTACH macro description:


EP=entry name
EPLOC=entry name addr
DE=list entry addr
Specifies the entry name, the address of the entry name, or the
address of the name field of a 62-byte entry name list. The entry
name is constructed using the BLDL macro. When EPLOC is coded,
entry name addr points to an eight-byte field. When the name is
less than eight characters, left-justify the name and pad with
blanks on the right to make up the eight characters.`

(DE is a BLDL directory list result from looking up a name in a PDS
directory.)

I'm trying to think of how to start a TCB that invokes a function
within my own load module.

One approach would be to have a tiny "helper" load module that accepted
a parameter that was the function's address; ATTACH would attach
that helper load module, which would then indirectly invoke the function.

That's good enough - but now I want to eliminate the "helper" load module.

Perhaps there is no way around it? You just have to have another load
module?

- Thanks -
- Dave Rivers -
--
***@dignus.com Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com
Richard Rogers
2017-08-26 10:31:07 UTC
Permalink
Raw Message
IDENTIFY EP=MYSUB,ENTRY=SUBENTRY
ATTACH EP=MYSUB,...

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On
Behalf Of Thomas David Rivers
Sent: Saturday, August 26, 2017 03:35
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: Create subtask w/out a load module?
Post by Barry Schwarz
On Fri, 25 Aug 2017 22:41:35 -0400, Thomas David Rivers
The ATTACH (or ATTACHX) macro is used to create a subtask - but it
requires (basically) a separate load module...
Is there a mechanism to create a subtask within the currently loaded
load-module?
You can specify the entry address using the EPLOC operand.
Hi Barry!

Thanks for the pointer! But I think EPLOC specifies
the address of the name.. the name is still an 8-byte load module name...

From the ATTACH macro description:


EP=entry name
EPLOC=entry name addr
DE=list entry addr
Specifies the entry name, the address of the entry name, or the
address of the name field of a 62-byte entry name list. The entry
name is constructed using the BLDL macro. When EPLOC is coded,
entry name addr points to an eight-byte field. When the name is
less than eight characters, left-justify the name and pad with
blanks on the right to make up the eight characters.`

(DE is a BLDL directory list result from looking up a name in a PDS
directory.)

I'm trying to think of how to start a TCB that invokes a function within my
own load module.

One approach would be to have a tiny "helper" load module that accepted a
parameter that was the function's address; ATTACH would attach that helper
load module, which would then indirectly invoke the function.

That's good enough - but now I want to eliminate the "helper" load module.

Perhaps there is no way around it? You just have to have another load
module?

- Thanks -
- Dave Rivers -
--
***@dignus.com Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email
to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Thomas David Rivers
2017-08-26 10:56:03 UTC
Permalink
Raw Message
Post by Richard Rogers
IDENTIFY EP=MYSUB,ENTRY=SUBENTRY
ATTACH EP=MYSUB,...
Thanks Richard!! I _knew_ there had to be some way to do this!

- Dave Rivers -
--
***@dignus.com Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com
Jeremy Nicoll
2017-08-26 11:06:41 UTC
Permalink
Raw Message
Post by Thomas David Rivers
Thanks for the pointer! But I think EPLOC specifies
the address of the name.. the name is still an 8-byte load
module name...
No, it's the name of the required entry-point.

A load module can have multiple named entry-points, though
of course only has one load-module / member name.

In the simplest case, the entry-point is at the very start of a load
module, and EP-name is then the same as the load-module name
but (clearly) if there's more than one they can't all be at the same
place or have the same name.
Post by Thomas David Rivers
Perhaps there is no way around it? You just have to have another load
module?
I don't see why. I wouldn't expect a second copy to be loaded unless
the load modue's attributes made it non-reentrant, non-sharable etc.
--
Jeremy Nicoll - my opinions are my own.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Steve Smith
2017-08-26 14:47:29 UTC
Permalink
Raw Message
I sure wish there was a way to ATTACH to an address, or that IDENTIFY
allowed me to create an ad-hoc name/address. I maintain a small
subroutine package that seems to have found its way into every kind of
situation that can cause IDENTIFY to fail. Most are purely the fault
of <expletive deleted/> programming in the client code, but there's
nothing I can do about that.

In "normal" programs, IDENTIFY will likely do what you want.

sas

On Sat, Aug 26, 2017 at 7:07 AM, Jeremy Nicoll
Post by Jeremy Nicoll
Post by Thomas David Rivers
Thanks for the pointer! But I think EPLOC specifies
the address of the name.. the name is still an 8-byte load
module name...
No, it's the name of the required entry-point.
A load module can have multiple named entry-points, though
of course only has one load-module / member name.
In the simplest case, the entry-point is at the very start of a load
module, and EP-name is then the same as the load-module name
but (clearly) if there's more than one they can't all be at the same
place or have the same name.
Post by Thomas David Rivers
Perhaps there is no way around it? You just have to have another load
module?
I don't see why. I wouldn't expect a second copy to be loaded unless
the load modue's attributes made it non-reentrant, non-sharable etc.
--
Jeremy Nicoll - my opinions are my own.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
sas

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Binyamin Dissen
2017-08-26 20:34:59 UTC
Permalink
Raw Message
Would seem to be quite simple to have an EP with code:

L 15,0(,1)
LA 1,4(,1)
BR 15

Then you plist would have as the first word the EP of the targeted code.



On Sat, 26 Aug 2017 10:48:38 -0400 Steve Smith <***@GMAIL.COM> wrote:

:>I sure wish there was a way to ATTACH to an address, or that IDENTIFY
:>allowed me to create an ad-hoc name/address. I maintain a small
:>subroutine package that seems to have found its way into every kind of
:>situation that can cause IDENTIFY to fail. Most are purely the fault
:>of <expletive deleted/> programming in the client code, but there's
:>nothing I can do about that.
:>
:>In "normal" programs, IDENTIFY will likely do what you want.
:>
:>sas
:>
:>On Sat, Aug 26, 2017 at 7:07 AM, Jeremy Nicoll
:><***@letterboxes.org> wrote:
:>> On Sat, 26 Aug 2017, at 10:35, Thomas David Rivers wrote:
:>>
:>>> Thanks for the pointer! But I think EPLOC specifies
:>>> the address of the name.. the name is still an 8-byte load
:>>> module name...
:>>
:>> No, it's the name of the required entry-point.
:>>
:>> A load module can have multiple named entry-points, though
:>> of course only has one load-module / member name.
:>>
:>> In the simplest case, the entry-point is at the very start of a load
:>> module, and EP-name is then the same as the load-module name
:>> but (clearly) if there's more than one they can't all be at the same
:>> place or have the same name.
:>>
:>>
:>>> Perhaps there is no way around it? You just have to have another load
:>>> module?
:>>
:>> I don't see why. I wouldn't expect a second copy to be loaded unless
:>> the load modue's attributes made it non-reentrant, non-sharable etc.

--
Binyamin Dissen <***@dissensoftware.com>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Steve Smith
2017-08-26 20:51:55 UTC
Permalink
Raw Message
That would be great if that module (IEFBR15?) was part of the system.
But if I could package a separate module with this thing, there would
be no issue anyway.

sas

On Sat, Aug 26, 2017 at 4:36 PM, Binyamin Dissen
Post by Binyamin Dissen
L 15,0(,1)
LA 1,4(,1)
BR 15
Then you plist would have as the first word the EP of the targeted code.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Binyamin Dissen
2017-08-26 20:54:55 UTC
Permalink
Raw Message
How is your subroutine getting control?

If it is standalone or linked to the application, it can IDENTIFY a part of
itself.

The only time this would not work is if you code is loaded into a getmained
area.


On Sat, 26 Aug 2017 16:53:05 -0400 Steve Smith <***@GMAIL.COM> wrote:

:>That would be great if that module (IEFBR15?) was part of the system.
:>But if I could package a separate module with this thing, there would
:>be no issue anyway.
:>
:>sas
:>
:>On Sat, Aug 26, 2017 at 4:36 PM, Binyamin Dissen
:><***@dissensoftware.com> wrote:
:>> Would seem to be quite simple to have an EP with code:
:>>
:>> L 15,0(,1)
:>> LA 1,4(,1)
:>> BR 15
:>>
:>> Then you plist would have as the first word the EP of the targeted code.
:>>
:>
:>----------------------------------------------------------------------
:>For IBM-MAIN subscribe / signoff / archive access instructions,
:>send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

--
Binyamin Dissen <***@dissensoftware.com>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Peter Relson
2017-08-27 23:39:49 UTC
Permalink
Raw Message
As has been mentioned, IDENTIFY can do what is asked for.
So can binding the load module with appropriate alias(es).

But also so can writing code so that you attach the same entry name but
the parameter data passed to the attached module tells the code where to
branch to (whether by a code or an address or some other mechanism).

Peter Relson
z/OS Core Technology Design


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Steve Smith
2017-08-28 13:31:53 UTC
Permalink
Raw Message
I've got cases where the module is copied into CSA (w/o benefit of
DYNLPA, and some with). I've got a case where the module is loaded by
a mother task, which ATTACHes its own code with JSTCB=YES, and then
the subtask BALRs into my module. IDENTIFY doesn't like such things.

Granted this is all self-inflicted pain. I mentioned the
ATTACH-to-address merely as a wish... I couldn't wait 2-3 years for
such a thing to be universally available anyway.

sas
Post by Peter Relson
As has been mentioned, IDENTIFY can do what is asked for.
So can binding the load module with appropriate alias(es).
But also so can writing code so that you attach the same entry name but
the parameter data passed to the attached module tells the code where to
branch to (whether by a code or an address or some other mechanism).
Peter Relson
z/OS Core Technology Design
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
sas

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2017-08-28 14:03:18 UTC
Permalink
Raw Message
Post by Steve Smith
I've got cases where the module is copied into CSA (w/o benefit of
DYNLPA, and some with). I've got a case where the module is loaded by
a mother task, which ATTACHes its own code with JSTCB=YES, and then
the subtask BALRs into my module. IDENTIFY doesn't like such things.
I once (24-bit era) wrote an ATTACHME program which loaded R15 with its
first argument; advanced R1 to the second, and branched.
Post by Steve Smith
Granted this is all self-inflicted pain. I mentioned the
ATTACH-to-address merely as a wish...
For me, it was an old wish.

Perhaps I was anticipating BPX1FRK.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Loading...