(too old to reply)
Calling Assembler module from REXX
Michael Munro
2008-09-22 21:30:58 UTC
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:18 UTC
-----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:53 UTC
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:40:31 UTC
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
Lindy Mayfield
2008-09-22 21:43:40 UTC
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
Paul Gilmartin
2008-09-22 22:00:20 UTC
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:28 UTC
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
Scott Ford
2008-09-22 22:17:59 UTC
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
Hunkeler Peter , KIUK 3
2008-09-23 06:41:38 UTC
>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
Wayne Driscoll
2008-09-23 13:49:51 UTC
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
Farley, Peter x23353
2008-09-23 14:15:37 UTC
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
Lindy Mayfield
2008-09-23 17:53:42 UTC
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
shmuel+ (Shmuel Metz , Seymour J.)
2008-09-23 23:10:09 UTC
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
Claudio Marcio
2008-09-24 04:21:49 UTC
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:43 UTC
> 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
Bri P
2008-09-24 08:36:58 UTC
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:37 UTC
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:13 UTC
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:51 UTC
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
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
Next Page >
Page 1 of 2