Discussion:
Calling Assembler module from REXX
(too old to reply)
Michael Munro
2008-09-22 21:30:57 UTC
Permalink
Hi
I am trying to help a REXX programmer with a CALL to an
Assembler
routine.

I can LINK to an assembler routine successfully, but I
cannot make
successive calls. The Address LINKMVS feature (as its name
suggests)
loads in a fresh version of the module on each invocation
thereby clearing any
values saved from previous CALLs.

The module to be called is an interface supplied to OPEN
READ and
CLOSE a bespoke database. Because of the technique I am
using the first
call opens OK, but the second call to read a record fails
because the
database is not open (or so it thinks because the re-loaded
module has lost its
"open" indicator).

Any ideas please.
Mike
--
Mike Munro MBCS,CITP_ ***@bcs.org.uk
Ornum Software Ltd (S) Tel/Fax:+44(0)7041 363 070
~ Mobile: +44(0)777 160 1496

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Thompson, Steve
2008-09-22 21:37:17 UTC
Permalink
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Michael Munro
Sent: Monday, September 22, 2008 4:21 PM
To: IBM-***@BAMA.UA.EDU
Subject: Calling Assembler module from REXX

Hi
I am trying to help a REXX programmer with a CALL to an
Assembler
routine.

I can LINK to an assembler routine successfully, but I
cannot make
successive calls. The Address LINKMVS feature (as its name
suggests)
loads in a fresh version of the module on each invocation
thereby clearing any
values saved from previous CALLs.

The module to be called is an interface supplied to OPEN
READ and
CLOSE a bespoke database. Because of the technique I am
using the first
call opens OK, but the second call to read a record fails
because the
database is not open (or so it thinks because the re-loaded
module has lost its
"open" indicator).
<SNIP>

What is the type of linkage for the assembler routine, REUS or RENT or
none of the above?

What it sounds like is the REXX code is either DELETEing the assembler
program, OR, it is linked with NOREUS and so you get a fresh copy each
time.

The storage that the assembler routine uses - what can it anchor it to?
Or what does it expect? Can you provide that storage anchor via the REXX
exec by establishing a variable that is set to NULL (and must be 4
bytes)?

Then on subsequent calls, pass that same variable and allow the
assembler routine to use it.

Just a few ideas.

Regards,
Steve Thompson

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Dave Day
2008-09-22 21:38:52 UTC
Permalink
Suggestions:

1)make the assembler routine re-entrant. Successive LOADS will up the use
count, but not actually bring in a new module.

2)pass the called routine a parm that says this is a successive call, not
the 1st.

3)if you can't do #2 above, take a look at NAME/TOKEN services.

4)if you can't do #3 above, create another load module that is not
re-entrant. Just a csect that is all 0's. Have the 1st routine search the
CDE chain for the non re-entrant one. Set indicators in the non re-entrant
dummy 0's load module that tells the other one what the status of things
are.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Lindy Mayfield
2008-09-22 21:43:39 UTC
Permalink
Also the RXVSAM on 268 uses Name/Tokens but I've not gone through it yet
to see how it works.

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Dave Day
Sent: 23. syyskuuta 2008 0:39
To: IBM-***@BAMA.UA.EDU
Subject: Re: Calling Assembler module from REXX

Suggestions:

1)make the assembler routine re-entrant. Successive LOADS will up the
use
count, but not actually bring in a new module.

2)pass the called routine a parm that says this is a successive call,
not
the 1st.

3)if you can't do #2 above, take a look at NAME/TOKEN services.

4)if you can't do #3 above, create another load module that is not
re-entrant. Just a csect that is all 0's. Have the 1st routine search
the
CDE chain for the non re-entrant one. Set indicators in the non
re-entrant
dummy 0's load module that tells the other one what the status of things

are.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Hunkeler Peter , KIUK 3
2008-09-23 06:41:37 UTC
Permalink
>1)make the assembler routine re-entrant. Successive LOADS will up the
> use count, but not actually bring in a new module.

This will not help. I don't know how LINKMVS is implemented but from the
word LINK in its name I would comclude that it is supposed to work like
the LINK SVC: Load-give control-delete. A fresh copy would be loaded in
every case.


Create a second module. The one called from REXX is trying to read a
Name/Token pair. If not found, it loads the second module and stores its
entry point address in the above mentioned Name/Token pair. The first
module will then find the Name/Token pair on subsequent calls and can
branch directly to the already loaded module.

If, what I conlcude from your initial post, your current implementation
requires an OPEN and a CLOSE call, then you can connect the load and N/T
pair creation to OPEN and the N/T pair deletion and the unload to the
CLOSE call.

--
Peter Hunkeler
Credit Suisse

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Lindy Mayfield
2008-09-22 21:40:29 UTC
Permalink
There is a nice Rexx assembler function on CBT file 268 called RXVSAM
which may do a lot of the things you are talking about. And it is
reentrant so you can call it many times.

Regards,
Lindy


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Michael Munro
Sent: 23. syyskuuta 2008 0:21
To: IBM-***@BAMA.UA.EDU
Subject: Calling Assembler module from REXX

Hi
I am trying to help a REXX programmer with a CALL to an
Assembler
routine.

I can LINK to an assembler routine successfully, but I
cannot make
successive calls. The Address LINKMVS feature (as its name
suggests)
loads in a fresh version of the module on each invocation
thereby clearing any
values saved from previous CALLs.

The module to be called is an interface supplied to OPEN
READ and
CLOSE a bespoke database. Because of the technique I am
using the first
call opens OK, but the second call to read a record fails
because the
database is not open (or so it thinks because the re-loaded
module has lost its
"open" indicator).

Any ideas please.
Mike
--
Mike Munro MBCS,CITP_ ***@bcs.org.uk
Ornum Software Ltd (S) Tel/Fax:+44(0)7041 363 070
~ Mobile: +44(0)777 160 1496

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Scott Ford
2008-09-22 22:17:58 UTC
Permalink
Yes, I agree cbttapes have a lot of good examples that can be tailored to
fit one's needs..or a least give you a framework to work from..


Scott Ford
Senior Systems Engineer | Forging Enterprise Identity | IdentityForge.com
(Main) 678.266.3399 x304 | (Cell) 609.346.0399 | (Fax) 678.266.3399
***@identityforge.com

This message is for the designated recipient only and may contain
priviledged, proprietary, or otherwise private information. If you have
received it in error, please notify the sender immediately and then delete
the original. Any other use of the email by you is prohibited.

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On Behalf
Of Lindy Mayfield
Sent: Monday, September 22, 2008 5:40 PM
To: IBM-***@BAMA.UA.EDU
Subject: Re: Calling Assembler module from REXX

There is a nice Rexx assembler function on CBT file 268 called RXVSAM
which may do a lot of the things you are talking about. And it is
reentrant so you can call it many times.

Regards,
Lindy


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Michael Munro
Sent: 23. syyskuuta 2008 0:21
To: IBM-***@BAMA.UA.EDU
Subject: Calling Assembler module from REXX

Hi
I am trying to help a REXX programmer with a CALL to an
Assembler
routine.

I can LINK to an assembler routine successfully, but I
cannot make
successive calls. The Address LINKMVS feature (as its name
suggests)
loads in a fresh version of the module on each invocation
thereby clearing any
values saved from previous CALLs.

The module to be called is an interface supplied to OPEN
READ and
CLOSE a bespoke database. Because of the technique I am
using the first
call opens OK, but the second call to read a record fails
because the
database is not open (or so it thinks because the re-loaded
module has lost its
"open" indicator).

Any ideas please.
Mike
--
Mike Munro MBCS,CITP_ ***@bcs.org.uk
Ornum Software Ltd (S) Tel/Fax:+44(0)7041 363 070
~ Mobile: +44(0)777 160 1496

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Paul Gilmartin
2008-09-22 22:00:19 UTC
Permalink
On Mon, 22 Sep 2008 16:38:38 -0500, Dave Day wrote:

>Suggestions:
>
>1)make the assembler routine re-entrant. Successive LOADS will up the use
>count, but not actually bring in a new module.
>
>2)pass the called routine a parm that says this is a successive call, not
>the 1st.
>
>3)if you can't do #2 above, take a look at NAME/TOKEN services.
>
>4)if you can't do #3 above, create another load module that is not
>re-entrant. Just a csect that is all 0's. Have the 1st routine search the
>CDE chain for the non re-entrant one. Set indicators in the non re-entrant
>dummy 0's load module that tells the other one what the status of things
>are.
>
All good ideas. For a variant of #2 with some influence from #4,
let the Rexx routine supply the working storage for the called
routine, initialized before the first call. See the use of
"ChainingVector" in SYS1.SAMPLIB(CSFTEST) for an example of the
Rexx side of this technique.

But none of these deal with the deficiency that Rexx LINKPGM/ATTCHPGM
will LOAD and DELETE even a REFReshable load module for each
invocation. This causes unwelcome overhead for large numbers
of invocations. So, perhaps:

5) Put the routine in LPA if permitted.

Would there perhaps be Rexx interfaces to LOAD and DELETE
on CBTTAPE (or similar) so the routine could be LOADed and
DELETed only once?

Would TSO-REXX supply better advice?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Scott Ford
2008-09-22 22:15:27 UTC
Permalink
We use Name/Token all the time, by allocating a block of storage ( depends
on your needs ), it's fairly easy to extract the stored data.


Scott Ford
Senior Systems Engineer | Forging Enterprise Identity | IdentityForge.com
(Main) 678.266.3399 x304 | (Cell) 609.346.0399 | (Fax) 678.266.3399
***@identityforge.com

This message is for the designated recipient only and may contain
priviledged, proprietary, or otherwise private information. If you have
received it in error, please notify the sender immediately and then delete
the original. Any other use of the email by you is prohibited.
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On Behalf
Of Paul Gilmartin
Sent: Monday, September 22, 2008 6:00 PM
To: IBM-***@BAMA.UA.EDU
Subject: Re: Calling Assembler module from REXX

On Mon, 22 Sep 2008 16:38:38 -0500, Dave Day wrote:

>Suggestions:
>
>1)make the assembler routine re-entrant. Successive LOADS will up the use
>count, but not actually bring in a new module.
>
>2)pass the called routine a parm that says this is a successive call, not
>the 1st.
>
>3)if you can't do #2 above, take a look at NAME/TOKEN services.
>
>4)if you can't do #3 above, create another load module that is not
>re-entrant. Just a csect that is all 0's. Have the 1st routine search the
>CDE chain for the non re-entrant one. Set indicators in the non re-entrant
>dummy 0's load module that tells the other one what the status of things
>are.
>
All good ideas. For a variant of #2 with some influence from #4,
let the Rexx routine supply the working storage for the called
routine, initialized before the first call. See the use of
"ChainingVector" in SYS1.SAMPLIB(CSFTEST) for an example of the
Rexx side of this technique.

But none of these deal with the deficiency that Rexx LINKPGM/ATTCHPGM
will LOAD and DELETE even a REFReshable load module for each
invocation. This causes unwelcome overhead for large numbers
of invocations. So, perhaps:

5) Put the routine in LPA if permitted.

Would there perhaps be Rexx interfaces to LOAD and DELETE
on CBTTAPE (or similar) so the routine could be LOADed and
DELETed only once?

Would TSO-REXX supply better advice?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Wayne Driscoll
2008-09-23 13:49:50 UTC
Permalink
If the module is linked RENT, you could have the assembler program issue a
LOAD macro for itself on the open call. For a RENT module, all this will do
is increment the use count. Then, when the program terminates, the use
count will be decremented, but since it is non-zero, the module will not be
deleted. But you have to remember to issue a DELETE macro on the CLOSE
call, in order to allow the module to be removed from storage when you are
done with it.

Wayne Driscoll
Product Developer
NOTE: All opinions are strictly my own.



-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On Behalf
Of Paul Gilmartin
Sent: Monday, September 22, 2008 5:00 PM
To: IBM-***@BAMA.UA.EDU
Subject: Re: Calling Assembler module from REXX

On Mon, 22 Sep 2008 16:38:38 -0500, Dave Day wrote:

>Suggestions:
>
>1)make the assembler routine re-entrant. Successive LOADS will up the use
>count, but not actually bring in a new module.
>
>2)pass the called routine a parm that says this is a successive call, not
>the 1st.
>
>3)if you can't do #2 above, take a look at NAME/TOKEN services.
>
>4)if you can't do #3 above, create another load module that is not
>re-entrant. Just a csect that is all 0's. Have the 1st routine search the
>CDE chain for the non re-entrant one. Set indicators in the non re-entrant
>dummy 0's load module that tells the other one what the status of things
>are.
>
All good ideas. For a variant of #2 with some influence from #4,
let the Rexx routine supply the working storage for the called
routine, initialized before the first call. See the use of
"ChainingVector" in SYS1.SAMPLIB(CSFTEST) for an example of the
Rexx side of this technique.

But none of these deal with the deficiency that Rexx LINKPGM/ATTCHPGM
will LOAD and DELETE even a REFReshable load module for each
invocation. This causes unwelcome overhead for large numbers
of invocations. So, perhaps:

5) Put the routine in LPA if permitted.

Would there perhaps be Rexx interfaces to LOAD and DELETE
on CBTTAPE (or similar) so the routine could be LOADed and
DELETed only once?

Would TSO-REXX supply better advice?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Lindy Mayfield
2008-09-23 17:53:41 UTC
Permalink
Two examples come to mind right away when talking about this: The
Rexx/DB2 interface and Rexx Sockets for TCP/IP communication. Do you
think that this is the method that they use, or does it really depend on
the application?

Could much be determined by doing some initial calls and dumping the
address space?

Lindy

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Wayne Driscoll
Sent: 23. syyskuuta 2008 16:49
To: IBM-***@BAMA.UA.EDU
Subject: Re: Calling Assembler module from REXX

If the module is linked RENT, you could have the assembler program issue
a
LOAD macro for itself on the open call. For a RENT module, all this
will do
is increment the use count. Then, when the program terminates, the use
count will be decremented, but since it is non-zero, the module will not
be
deleted. But you have to remember to issue a DELETE macro on the CLOSE
call, in order to allow the module to be removed from storage when you
are
done with it.

Wayne Driscoll
Product Developer
NOTE: All opinions are strictly my own.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Claudio Marcio
2008-09-24 04:21:48 UTC
Permalink
Hi,

I need make one REXX exec to enter with one year the return the day
christmas of week.
ex: year 1978
day of th week - monday

year 2000
day of the week - saturday

how meke in REXX language?

regards


----- Original Message -----
From: "Paul Gilmartin" <***@AIM.COM>
Newsgroups: bit.listserv.ibm-main
To: <IBM-***@BAMA.UA.EDU>
Sent: Monday, September 22, 2008 7:00 PM
Subject: Re: Calling Assembler module from REXX


> On Mon, 22 Sep 2008 16:38:38 -0500, Dave Day wrote:
>
>>Suggestions:
>>
>>1)make the assembler routine re-entrant. Successive LOADS will up the use
>>count, but not actually bring in a new module.
>>
>>2)pass the called routine a parm that says this is a successive call, not
>>the 1st.
>>
>>3)if you can't do #2 above, take a look at NAME/TOKEN services.
>>
>>4)if you can't do #3 above, create another load module that is not
>>re-entrant. Just a csect that is all 0's. Have the 1st routine search
>>the
>>CDE chain for the non re-entrant one. Set indicators in the non
>>re-entrant
>>dummy 0's load module that tells the other one what the status of things
>>are.
>>
> All good ideas. For a variant of #2 with some influence from #4,
> let the Rexx routine supply the working storage for the called
> routine, initialized before the first call. See the use of
> "ChainingVector" in SYS1.SAMPLIB(CSFTEST) for an example of the
> Rexx side of this technique.
>
> But none of these deal with the deficiency that Rexx LINKPGM/ATTCHPGM
> will LOAD and DELETE even a REFReshable load module for each
> invocation. This causes unwelcome overhead for large numbers
> of invocations. So, perhaps:
>
> 5) Put the routine in LPA if permitted.
>
> Would there perhaps be Rexx interfaces to LOAD and DELETE
> on CBTTAPE (or similar) so the routine could be LOADed and
> DELETed only once?
>
> Would TSO-REXX supply better advice?
>
> -- gil
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
> Search the archives at http://bama.ua.edu/archives/ibm-main.html
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Dave Salt
2008-09-24 05:26:42 UTC
Permalink
> From: ***@GMAIL.COM
> I need make one REXX exec to enter with one year the return the day
> christmas of week.
> ex: year 1978 day of the week - monday

Try this:

/* REXX to display day of the week Christmas falls on. */
/*********************************************/
arg year
if year = "" then year = right(date(),4)

dec25 = date("B",year"1225","S")//7
select
when dec25 = 0 then day = "Monday"
when dec25 = 1 then day = "Tuesday"
when dec25 = 2 then day = "Wednesday"
when dec25 = 3 then day = "Thursday"
when dec25 = 4 then day = "Friday"
when dec25 = 5 then day = "Saturday"
otherwise day = "Sunday"
end
say "In the year "year", Christmas day falls on "day
EXIT


Hope that helps,

Dave Salt

SimpList(tm) - try it; you'll get it!
http://www.mackinney.com/products/SIM/simplist.htm



_________________________________________________________________

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Farley, Peter x23353
2008-09-23 14:15:37 UTC
Permalink
Mike,

Since I surmise that the supplied assembler module isn't your own code,
you are going to have to write an "interface module" between the REXX
program and the "bespoke database" module.

Your "interface module" should use one of the techniques others have
described (I prefer the "name/token" method myself) to retain the data
returned by the vendor-supplied routine in "working storage" as it were,
as well as the address of the supplied module. The "name/token" service
will allow you to getmain some storage for the arguments and remember
the address of that storage in the "name/token" area. It will also
allow you to load the supplied module and to remember its address in the
getmained storage.

Sketchy preliminary logic sample, customize as you need:

1. Use name/token services to retrieve unique name.
2. Name doesn't exist, getmain enough storage for working area and store
address in new unique name/token. Also load vendor-supplied assembler
routine and store module address in gotten storage.
3. Name exists, retrieve getmain address from token and module address
from gotten storage.
4. Call assembler routine using the module address, with parameters as
appropriate.
5. If this was a "CLOSE" call, delete the assembler module, free the
getmained storage and delete the unique name/token.

Alternatively of course, you could require the database vendor to supply
a REXX-friendly interface module so they have to do the coding instead
of you... :) IMHO, it's quite sloppy coding practice for someone to
supply you with a module that depends on values retained in their
program between calls.

HTH

Peter
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
> Behalf Of Michael Munro
> Sent: Monday, September 22, 2008 5:21 PM
> To: IBM-***@BAMA.UA.EDU
> Subject: Calling Assembler module from REXX
>
> Hi
> I am trying to help a REXX programmer with a CALL to an
> Assembler routine.
>
> I can LINK to an assembler routine successfully, but I
> cannot make successive calls. The Address LINKMVS feature (as its name
> suggests) loads in a fresh version of the module on each invocation
> thereby clearing any values saved from previous CALLs.
>
> The module to be called is an interface supplied to OPEN
> READ and CLOSE a bespoke database. Because of the technique I am
> using the first call opens OK, but the second call to read a record
fails
> because the database is not open (or so it thinks because the
re-loaded
> module has lost its "open" indicator).
>
> Any ideas please.
> Mike
This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
shmuel+ (Shmuel Metz , Seymour J.)
2008-09-23 23:10:09 UTC
Permalink
In <***@mail.red.net>, on 09/22/2008
at 10:20 PM, Michael Munro <***@BCS.ORG.UK> said:

>loads in a fresh version of the module on each invocation

I'd advise writing some glue code in HLA. That could be as simple as
routines to load, call and delete the routine, or REXX-aware wrappers to
do some of the housekeeping.

--
Shmuel (Seymour J.) Metz, SysProg and JOAT
ISO position; see <http://patriot.net/~shmuel/resume/brief.html>
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Bri P
2008-09-24 08:36:57 UTC
Permalink
Christmas = 20081225
Weekday = DATE('W',Christmas,'S')

Brian

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On Behalf Of Claudio Marcio
Sent: 24 September 2008 05:21
To: IBM-***@BAMA.UA.EDU
Subject: REXX EXEC

Hi,

I need make one REXX exec to enter with one year the return the day
christmas of week.
ex: year 1978
day of th week - monday

year 2000
day of the week - saturday

how meke in REXX language?

regards


-----------------------------------------
Email sent from www.virginmedia.com/email
Virus-checked using McAfee(R) Software and scanned for spam

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Lindy Mayfield
2008-09-24 11:13:36 UTC
Permalink
Yes, but there is always a simpler solution:

/* Rexx */
year=2010
y=year//100
c=(year-year//100)/100
mons = 'Sat Sun Mon Tue Wed Thu Fri'
say word(mons,((y+trunc(y/4)+31+substr(6420,(c//4)+1,1))//7)+1)
exit 0


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Bri P
Sent: 24. syyskuuta 2008 11:37
To: IBM-***@BAMA.UA.EDU
Subject: Re: REXX EXEC

Christmas = 20081225
Weekday = DATE('W',Christmas,'S')

Brian

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Claudio Marcio
Sent: 24 September 2008 05:21
To: IBM-***@BAMA.UA.EDU
Subject: REXX EXEC

Hi,

I need make one REXX exec to enter with one year the return the day
christmas of week.
ex: year 1978
day of th week - monday

year 2000
day of the week - saturday

how meke in REXX language?

regards

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
P S
2008-09-24 13:02:12 UTC
Permalink
This is simpler? Three lines to replace one?

I'd hate to see your definition of "cheaper" ... :-)

On Wed, Sep 24, 2008 at 7:13 AM, Lindy Mayfield
<***@ssf.sas.com> wrote:
> Yes, but there is always a simpler solution:
>
> /* Rexx */
> year=2010
> y=year//100
> c=(year-year//100)/100
> mons = 'Sat Sun Mon Tue Wed Thu Fri'
> say word(mons,((y+trunc(y/4)+31+substr(6420,(c//4)+1,1))//7)+1)
> exit 0
>
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
> Behalf Of Bri P
> Sent: 24. syyskuuta 2008 11:37
> To: IBM-***@BAMA.UA.EDU
> Subject: Re: REXX EXEC
>
> Christmas = 20081225
> Weekday = DATE('W',Christmas,'S')

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
shmuel+ (Shmuel Metz , Seymour J.)
2008-09-24 13:25:50 UTC
Permalink
In <***@emeamail15.emea.sas.com>, on
09/24/2008
at 01:13 PM, Lindy Mayfield <***@SSF.SAS.COM> said:

>Yes, but there is always a simpler solution:

"things should always be as simple as possible, but no simpler."

Yes, I know that we'll all be dead by the time that it breaks, but it's
actually easier to do it in a more robust form.

--
Shmuel (Seymour J.) Metz, SysProg and JOAT
ISO position; see <http://patriot.net/~shmuel/resume/brief.html>
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Mansell, George R.
2008-09-24 18:07:49 UTC
Permalink
A mod 400 year is also a leap year.

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Lindy Mayfield
Sent: Wednesday, September 24, 2008 6:13 AM
To: IBM-***@BAMA.UA.EDU
Subject: Re: REXX EXEC

Yes, but there is always a simpler solution:

/* Rexx */
year=2010
y=year//100
c=(year-year//100)/100
mons = 'Sat Sun Mon Tue Wed Thu Fri'
say word(mons,((y+trunc(y/4)+31+substr(6420,(c//4)+1,1))//7)+1)
exit 0


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Bri P
Sent: 24. syyskuuta 2008 11:37
To: IBM-***@BAMA.UA.EDU
Subject: Re: REXX EXEC

Christmas = 20081225
Weekday = DATE('W',Christmas,'S')

Brian

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Claudio Marcio
Sent: 24 September 2008 05:21
To: IBM-***@BAMA.UA.EDU
Subject: REXX EXEC

Hi,

I need make one REXX exec to enter with one year the return the day
christmas of week.
ex: year 1978
day of th week - monday

year 2000
day of the week - saturday

how meke in REXX language?

regards

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


------------------------------------------------------------------------------
NOTICE: This electronic mail message and any attached files are confidential. The information is exclusively for the use of the individual or entity intended as the recipient. If you are not the intended recipient, any use, copying, printing, reviewing, retention, disclosure, distribution or forwarding of the message or any attached file is not authorized and is strictly prohibited. If you have received this electronic mail message in error, please advise the sender by reply electronic mail immediately and permanently delete the original transmission, any attachments and any copies of this message from your computer system. Thank you.

==============================================================================

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Lindy Mayfield
2008-09-24 18:13:40 UTC
Permalink
But it doesn't matter if it is a leap year for the month of December, is
that right?

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Mansell, George R.
Sent: 24. syyskuuta 2008 21:07
To: IBM-***@BAMA.UA.EDU
Subject: Re: REXX EXEC

A mod 400 year is also a leap year.

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Lindy Mayfield
Sent: Wednesday, September 24, 2008 6:13 AM
To: IBM-***@BAMA.UA.EDU
Subject: Re: REXX EXEC

Yes, but there is always a simpler solution:

/* Rexx */
year=2010
y=year//100
c=(year-year//100)/100
mons = 'Sat Sun Mon Tue Wed Thu Fri'
say word(mons,((y+trunc(y/4)+31+substr(6420,(c//4)+1,1))//7)+1)
exit 0


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Bri P
Sent: 24. syyskuuta 2008 11:37
To: IBM-***@BAMA.UA.EDU
Subject: Re: REXX EXEC

Christmas = 20081225
Weekday = DATE('W',Christmas,'S')

Brian

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Claudio Marcio
Sent: 24 September 2008 05:21
To: IBM-***@BAMA.UA.EDU
Subject: REXX EXEC

Hi,

I need make one REXX exec to enter with one year the return the day
christmas of week.
ex: year 1978
day of th week - monday

year 2000
day of the week - saturday

how meke in REXX language?

regards

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


------------------------------------------------------------------------
------
NOTICE: This electronic mail message and any attached files are
confidential. The information is exclusively for the use of the
individual or entity intended as the recipient. If you are not the
intended recipient, any use, copying, printing, reviewing, retention,
disclosure, distribution or forwarding of the message or any attached
file is not authorized and is strictly prohibited. If you have received
this electronic mail message in error, please advise the sender by reply
electronic mail immediately and permanently delete the original
transmission, any attachments and any copies of this message from your
computer system. Thank you.

========================================================================
======

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Chase, John
2008-09-24 18:20:20 UTC
Permalink
> -----Original Message-----
> From: IBM Mainframe Discussion List On Behalf Of Lindy Mayfield
>
> But it doesn't matter if it is a leap year for the month of
> December, is that right?

The day of week calculation would be off by one if the leap year is
ignored.

-jc-

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Lindy Mayfield
2008-09-24 18:31:58 UTC
Permalink
Hmmm. I checked it with quite a number of years going back to 1200
against calendars and didn't find any errors yet. Anyway, it was just a
mental exercise. Why should the C and Perl people get all the fun?

The Rexx date function is of course the far superior solution.

lindy

#!/usr/local/bin/perl -s do
r=1;$_=substr($_."\0"x$w,$c=0,$w);s/.|\n/$c=&badd(&bmul
($c,256),ord$&)/ge;$_=$k;s/./$r=&bmod(&bmul($r,$r),$x),$&?$r=&bmod(&bmul
($r,$c ),$x):0,""/ge;($r,$t)=&bdiv($r,256),$_=pack(C,$t).$_
while$w--+1-2*$d;print}

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
Behalf Of Chase, John
Sent: 24. syyskuuta 2008 21:20
To: IBM-***@BAMA.UA.EDU
Subject: Re: REXX EXEC

> -----Original Message-----
> From: IBM Mainframe Discussion List On Behalf Of Lindy Mayfield
>
> But it doesn't matter if it is a leap year for the month of
> December, is that right?

The day of week calculation would be off by one if the leap year is
ignored.

-jc-

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Mark Zelden
2008-09-24 18:51:05 UTC
Permalink
I used my rdate exec / rdatef function prior to OS/390 2.4 (when the
REXX built in DATE function was enhanced to convert between date
formats). I still do use it at times because the built in function doesn't
support some to / from formats.

http://home.flash.net/~mzelden/mvsfiles/rdate.txt
http://home.flash.net/~mzelden/mvsfiles/rdatef.txt

But this exercise didn't take any conversion.

Speaking of simple, how about this one:

/* rexx */
/* The following was provided by Mark Barnett, Stanford */
/* Linear Accelerator Center: */

/* DAY EXEC -- Given a Gregorian date, returns its weekday */
/* (U.S: Gregorian 9/14/1752 followed 9/2/1752 O.S.--Old Style) */
/* (CACM, 10/72, p. 918; Computerworld, 2/11/80, p. 30) */
/* Accepts m d y with blank, /, or - as separators. Two-digit */
/* years are prefixed with 19 (leading 0's are permitted). */
/* May be appended to another REXX exec, for use as an internal */
/* routine, by "uncommenting" the "Procedure" statement. */

DAY: /* Procedure; */ Signal on SYNTAX; ret=0; n="ARG"()
Arg a1, a2, a3, a4, a5, bad; s=a1 a2 a3 a4 a5; args=s bad
If n>5 | a1='?' Then Signal "SYNTAX"; If a1='' Then s="DATE"('USA')
s="TRANSLATE"(s,' ','/-'); Parse var s m d y bad
If bad^='' Then Signal 'SYNTAX'; If "LENGTH"(y)=2 Then y='19'y
/* m=month d=day y=year (m and y are adjusted during computation) */

y=y+(m-14)%12 /* Adjust month, year; March = month 1 of its */
m=(m+9)//12+1 /* year, February = month 12 of previous.) */
m="TRUNC"(2.6*m-.1) /* Month residue, using Zeller's Congruence */
c=y%100; y=y//100 /* century, year-within-century temporaries */

i=(d+m+y+y%4+5*c+c%4-c%40)//7+1
/* | | | | | | | | > magic from the sky (initial day) */
/* | | | | | | | > modulo 7 days/week */
/* | | | | | | > century years div. by 4000 are not leap */
/* | | | | | > most century years div. by 400 are leap years */
/* | | | | > days/century adjustment: (100+24)*c = 5*c (mod 7) */
/* | | | > one day for each (non-00) leap-year-within-century */
/* | | > one day for each year-within-century: 365 (mod 7) = 1 */
/* | > residual days (mod 28) in previous months (+2) -- Zeller */
/* > day of the month */

w.1='Sunday'; w.2='Monday'; w.3='Tuesday'; w.4='Wednesday'
w.5='Thursday'; w.6='Friday'; w.7='Saturday'; result=w.i

RETURN: Parse SOURCE . s2 s3 .
If s2='COMMAND' & s3='DAY' Then Do
If result^='' Then Say result; Return ret; End
/* Return result */
say result
Return

SYNTAX: Say 'From DAY, called with following argument(s):' args
Say ' '
Say 'DAY returns the day of the week for an input date.'
Say ' '; Say ' DAY <month> <day> <year>'; Say ' '
Say 'where:'; Say ' '
Say ' <month> is the number of the month (January is 1, etc.), and'
Say ' <day> is the day of the month,'
Say ' <year> is the year.'; Say ' '
Say 'Characters / and - are valid separators for the arguments. A'
Say "two-digit <year> is assumed to imply a '19' prefix. If there"
Say "are NO arguments, today's date is assumed. A leading '?' or"
Say 'an argument error yields this message. DAY also may be'
Say 'called as a REXX function, in which case it may be called'
Say 'with either a single or multiple argument strings.'
result=''; If args^='?' Then ret='20040'; Signal 'RETURN'


--
Mark Zelden
Sr. Software and Systems Architect - z/OS Team Lead
Zurich North America / Farmers Insurance Group - ZFUS G-ITO
mailto:***@zurichna.com
z/OS Systems Programming expert at http://expertanswercenter.techtarget.com/
Mark's MVS Utilities: http://home.flash.net/~mzelden/mvsutil.html



On Wed, 24 Sep 2008 13:13:19 +0200, Lindy Mayfield
<***@SSF.SAS.COM> wrote:

>Yes, but there is always a simpler solution:
>
>/* Rexx */
>year=2010
>y=year//100
>c=(year-year//100)/100
>mons = 'Sat Sun Mon Tue Wed Thu Fri'
>say word(mons,((y+trunc(y/4)+31+substr(6420,(c//4)+1,1))//7)+1)
>exit 0
>
>
>-----Original Message-----
>From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
>Behalf Of Bri P
>Sent: 24. syyskuuta 2008 11:37
>To: IBM-***@BAMA.UA.EDU
>Subject: Re: REXX EXEC
>
> Christmas = 20081225
> Weekday = DATE('W',Christmas,'S')
>
>Brian
>
>-----Original Message-----
>From: IBM Mainframe Discussion List [mailto:IBM-***@BAMA.UA.EDU] On
>Behalf Of Claudio Marcio
>Sent: 24 September 2008 05:21
>To: IBM-***@BAMA.UA.EDU
>Subject: REXX EXEC
>
>Hi,
>
>I need make one REXX exec to enter with one year the return the day
>christmas of week.
>ex: year 1978
> day of th week - monday
>
> year 2000
> day of the week - saturday
>
> how meke in REXX language?
>
>regards
>
>----------------------------------------------------------------------
>For IBM-MAIN subscribe / signoff / archive access instructions,
>send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
>Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Ted MacNEIL
2008-09-24 23:22:25 UTC
Permalink
>A mod 400 year is also a leap year.

More to the point, century year that is not a mod 400 year is not a leap year.
-
Too busy driving to stop for gas!

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Loading...