Re: Friday OT, cheerful program for gloomy times

2020-04-29 Thread CM Poncelet
conditional macro assembler as in (readable form):
 
.EXTRM   ANOP  TERMINAL EXCLUDES DEFINITION 
.*  
  SETA  1
  SETC  '' 
&@SYSSETC  'EXCL' 
&@SYSDCH''  EXCLUDES COUNT
.*   
.EXLOOP  AIF   ().@EXHEX
  SETA  &@EXCLUD()   CONVERT EXCLUDES TO HEXADECIMAL
  SETA  /16<-- modulo 16 part 1   
  
  SETC  '(+1)'   
  SETA  (*16)  <-- modulo 16 part 2   
  
  SETC  '(+1)'   
&@EXCLUD() SETC  ''  
.@EXHEX  DCXL1'&@EXCLUD()'  EXCLUDED   
  SETA  +1  
 AIF   ( LE ).EXLOOP 
&@SYSSETC  'EXMK'  
&@SYSDCXL2''   END OF EXCLUDES MARKER 
.*
 MNOTE *,' COUNT OF TERMINALS EXCLUDED = '  
&@NZ SETC  'EXTRMOK'  
 AGO   .EXCNTL END OF TERMINAL EXCLUDES   
.*
.**   
.*
.EXCLEND ANOP  END OF TERMINAL EXCLUDES BLOCK 
&@NZ SETC  'EXCLOK'  
.EXDONE  AGO   .EXCNTL
.* 
 

 
Cheers. 



On 29/04/2020 03:05, Paul Gilmartin wrote:
> On Wed, 29 Apr 2020 02:57:23 +0100, CM Poncelet wrote:
>
>> ... but that's the only way to do it in conditional macro assembler; so
>> what me worry about 3GL's? :)
>>
> What hardware?  Doesn't Divide leave the quotient in one register and the
> remainder in an adjacent one?
>
>> On 28/04/2020 10:46, David Crayford wrote:
>>> No worries. FWIW,  I think using the // modulo operator would make
>>> your code less verbose and complex ;)
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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


Re: Friday OT, cheerful program for gloomy times

2020-04-29 Thread CM Poncelet
conditional macro assembler as in:
 
.EXTRM   ANOP  TERMINAL EXCLUDES DEFINITION
00075800
.* 
00075900
  SETA  1   
00076000
  SETC  ''
00076100
&@SYS    SETC  'EXCL'   
00076200
&@SYS    DC    H''  EXCLUDES COUNT  
00076336
.* 
00076400
.EXLOOP  AIF   ().@EXHEX 
00076500
  SETA  &@EXCLUD()   CONVERT EXCLUDES TO HEXADECIMAL 
00076600
  SETA  /16  
00076700 <--
  SETC  '(+1)'
00076800
  SETA  (*16)
00076900 <--
  SETC  '(+1)'
00077000
&@EXCLUD() SETC  ''   
00077100
.@EXHEX  DC    XL1'&@EXCLUD()'  EXCLUDED
00077200
  SETA  +1   
00077300
 AIF   ( LE ).EXLOOP  
00077400
&@SYS    SETC  'EXMK'   
00077500
&@SYS    DC    XL2''   END OF EXCLUDES MARKER  
00077600
.* 
00077700
 MNOTE *,' COUNT OF TERMINALS EXCLUDED = '   
00077800
&@NZ SETC  'EXTRMOK'   
00077900
 AGO   .EXCNTL END OF TERMINAL EXCLUDES
00078000
.* 
00078100
 

 
Cheers.
 


On 29/04/2020 03:05, Paul Gilmartin wrote:
> On Wed, 29 Apr 2020 02:57:23 +0100, CM Poncelet wrote:
>
>> ... but that's the only way to do it in conditional macro assembler; so
>> what me worry about 3GL's? :)
>>
> What hardware?  Doesn't Divide leave the quotient in one register and the
> remainder in an adjacent one?
>
>> On 28/04/2020 10:46, David Crayford wrote:
>>> No worries. FWIW,  I think using the // modulo operator would make
>>> your code less verbose and complex ;)
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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


Re: Friday OT, cheerful program for gloomy times

2020-04-28 Thread Paul Gilmartin
On Wed, 29 Apr 2020 02:57:23 +0100, CM Poncelet wrote:

>... but that's the only way to do it in conditional macro assembler; so
>what me worry about 3GL's? :)
>
What hardware?  Doesn't Divide leave the quotient in one register and the
remainder in an adjacent one?

>On 28/04/2020 10:46, David Crayford wrote:
>> No worries. FWIW,  I think using the // modulo operator would make
>> your code less verbose and complex ;)

-- gil

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


Re: Friday OT, cheerful program for gloomy times

2020-04-28 Thread CM Poncelet
... but that's the only way to do it in conditional macro assembler; so
what me worry about 3GL's? :)

On 28/04/2020 10:46, David Crayford wrote:
> No worries. FWIW,  I think using the // modulo operator would make
> your code less verbose and complex ;)
>
> On 2020-04-28 11:14 AM, CM Poncelet wrote:
>> Yes, you are absolutely right. I thought it was the other way round,
>> divisble by 100 being leap years and by 400 not leap years.
>>   It should have been
>>    LEAP  = (YEAR-YEAR%4*4=0 & YEAR-YEAR%100*100¬=0 |
>> YEAR-YEAR%400*400=0)
>>   This does not affect the calculations themselves, but it does report
>> incorrectly e.g. that 2000.0229 is not valid.
>>   Thanks a lot for pointing this out.
>>   Cheers, Chris Poncelet
>>    
>> On 27/04/2020 10:01, David Crayford wrote:
>>> FYI, you have a bug with your leap year calculation. You need to check
>>> if the year is evenly dividable by 100 (which are not leap years
>>> unless evenly divisible by 400).
>>>
>>> isleap: procedure
>>>    arg year .
>>>    return (year // 4 = 0 & year // 100 /= 0 ) | year // 400 = 0
>>>
>>> On 2020-04-24 2:01 PM, CM Poncelet wrote:
 I attach a Rexx program to calculate and display the biorhythm values
 for a given date of birth and current or whatever other date.
    If 'management' complains that home workers are not putting enough
 effort into their working-from-home time, they can run this thing and
 send its output to 'management' just to prove that they are in perfect
 working condition and that any slow-down in productivity must be
 due to
 external factors which are wholly beyond their control .
    Cheers, Chris Poncelet (retired sysprog)

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

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


Re: Friday OT, cheerful program for gloomy times

2020-04-28 Thread Seymour J Metz
That's an example of why I bought Tritus SPF (TSPF) instead of CTC.

ISREDIT is the environment for ISPF/PDF EDIT, and any EDIT macro needs services 
in that environment. address ISPEXEC ISREDIT foo is a slower way of doing 
address ISREDIT foo.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of CM 
Poncelet [ponce...@bcs.org.uk]
Sent: Monday, April 27, 2020 11:47 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

Thanks, but I get the following errors:

ecalc(182): Error #39, Evaluation stack overflow
do until tmp = tail

PRESS ANY KEY TO CONTINUE.

and

Error 10: Illegal ISPEXEC Service 'isredit macro (parm) NOPROCESS'.

PRESS ANY KEY TO CONTINUE.

I have CTC Rexx running under DOS - perhaps not the right environment
for this 

Cheers, Chris



On 27/04/2020 15:29, Robert Prins wrote:
> On 2020-04-24 06:01, CM Poncelet wrote:
>> I attach a Rexx program to calculate and display the biorhythm values
>> for a given date of birth and current or whatever other date.
>
> And if you want to see some niche graphs, try "ecalc
> biog(dd.mm.)", where ecalc can be found (for now) @
> <https://secure-web.cisco.com/1IEjFWf_WpIzXSZGtslQ5NgyLlgelQ0Isk6VdTTMOJNR6rNFOdFyWDUc2sHnbOFOoOET604fO0-Op5_pJZRlp--kSbYjvq0VamP5TX_CsM4kMJqBUkIX25jYILwaV7R6uE8yeV9H1lkubTRGsplg5etFaV1CrnyNERMmSzBHdkq4J_L0rESTs5d_qYIu5QavSNv6Joy93XMvhVve06js4K6aJV_CCz996lWYOSgtg9--_y2VaxtFyXBhoqPGU5TRZn5_-W0qJQ1F8GhlOrj-7AAbNTS9HckC_nU_NXYVkAPLm999qxnwMOin6cCgpfEvcv2w1fqMkEpYQthRTdj6CVJAlcEiT0mi0f8LAOPNU0UtuuPOV0uiA-7-1YEjJxbGCDS7GSQS1b7b37uLu0rkeain9IJBvdw9En-2bncOZ2NBxI0V-sSWKX6cTQuu1itzj/https%3A%2F%2Fprino.neocities.org%2Ftemp%2Fecalc.rexx.txt>
>
> Also contains a few other more-or-lesser useful conversions, "ecalc ?"
> will display some help.
>
> Robert

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

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


Re: Friday OT, cheerful program for gloomy times

2020-04-28 Thread CM Poncelet
Thanks - I have figured out how to use it.
 
It's an edit macro and it must therefore be saved with an ".spf"
extension instead of the ".isp" one used for CTC Rexx execs. Also, it
needs to be invoked while editing a file and not issued as a TSO
command. When all that is done, it works OK.
 
Thanks again.
 
Cheers, Chris


On 28/04/2020 13:56, Robert Prins wrote:
> On 2020-04-28 03:47, CM Poncelet wrote:
>> Thanks, but I get the following errors:
>>   ecalc(182): Error #39, Evaluation stack overflow
>>  do until tmp = tail
>>
>> PRESS ANY KEY TO CONTINUE.
>>   and
>>   Error 10: Illegal ISPEXEC Service 'isredit macro (parm) NOPROCESS'.
>>
>> PRESS ANY KEY TO CONTINUE.
>>   I have CTC Rexx running under DOS - perhaps not the right environment
>> for this 
>
> It probably isn't, and as I do not have access to CTC Rexx, it's
> highly unlikely that I'll ever update it for that environment.
> However, it probably should get a bit of TLC, given that the last
> update was nearly 11 years ago!
>
> I can only suggest you try a "trace ?r" to see why the error occurs.
>
> FWIW, if cross-over points are critical, I can concur, yesterday my
> P-cycle went through zero, and I managed to put my finger on a still
> running band-sander. Result wasn't pretty.
>
> And for what it's worth, if you use ecalc as a TSO command, you'll
> have to move the resulting long-message window to correctly see the
> biorhythm graph, on my 160x62 screen moving the left edge to column
> 91/2/3/4 will give you a correct display.
>
> Robert

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


Re: Friday OT, cheerful program for gloomy times

2020-04-28 Thread Robert Prins

On 2020-04-28 03:47, CM Poncelet wrote:

Thanks, but I get the following errors:
  
ecalc(182): Error #39, Evaluation stack overflow

     do until tmp = tail

PRESS ANY KEY TO CONTINUE.
  
and
  
Error 10: Illegal ISPEXEC Service 'isredit macro (parm) NOPROCESS'.


PRESS ANY KEY TO CONTINUE.
  
I have CTC Rexx running under DOS - perhaps not the right environment

for this 


It probably isn't, and as I do not have access to CTC Rexx, it's highly unlikely 
that I'll ever update it for that environment. However, it probably should get a 
bit of TLC, given that the last update was nearly 11 years ago!


I can only suggest you try a "trace ?r" to see why the error occurs.

FWIW, if cross-over points are critical, I can concur, yesterday my P-cycle went 
through zero, and I managed to put my finger on a still running band-sander. 
Result wasn't pretty.


And for what it's worth, if you use ecalc as a TSO command, you'll have to move 
the resulting long-message window to correctly see the biorhythm graph, on my 
160x62 screen moving the left edge to column 91/2/3/4 will give you a correct 
display.


Robert
--
Robert AH Prins
robert(a)prino(d)org
The hitchhiking grandfather - https://prino.neocities.org/indez.html
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html


On 27/04/2020 15:29, Robert Prins wrote:

On 2020-04-24 06:01, CM Poncelet wrote:

I attach a Rexx program to calculate and display the biorhythm values
for a given date of birth and current or whatever other date.


And if you want to see some niche graphs, try "ecalc
biog(dd.mm.)", where ecalc can be found (for now) @


Also contains a few other more-or-lesser useful conversions, "ecalc ?"
will display some help.

Robert


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




--
Robert AH Prins
robert.ah.prins(a)gmail.com
The hitchhiking grandfather - https://prino.neocities.org/indez.html
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html

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


Re: Friday OT, cheerful program for gloomy times

2020-04-28 Thread David Crayford
No worries. FWIW,  I think using the // modulo operator would make your 
code less verbose and complex ;)


On 2020-04-28 11:14 AM, CM Poncelet wrote:

Yes, you are absolutely right. I thought it was the other way round,
divisble by 100 being leap years and by 400 not leap years.
  
It should have been

   LEAP  = (YEAR-YEAR%4*4=0 & YEAR-YEAR%100*100¬=0 | YEAR-YEAR%400*400=0)
  
This does not affect the calculations themselves, but it does report

incorrectly e.g. that 2000.0229 is not valid.
  
Thanks a lot for pointing this out.
  
Cheers, Chris Poncelet
  
  


On 27/04/2020 10:01, David Crayford wrote:

FYI, you have a bug with your leap year calculation. You need to check
if the year is evenly dividable by 100 (which are not leap years
unless evenly divisible by 400).

isleap: procedure
   arg year .
   return (year // 4 = 0 & year // 100 /= 0 ) | year // 400 = 0

On 2020-04-24 2:01 PM, CM Poncelet wrote:

I attach a Rexx program to calculate and display the biorhythm values
for a given date of birth and current or whatever other date.
   If 'management' complains that home workers are not putting enough
effort into their working-from-home time, they can run this thing and
send its output to 'management' just to prove that they are in perfect
working condition and that any slow-down in productivity must be due to
external factors which are wholly beyond their control .
   Cheers, Chris Poncelet (retired sysprog)

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

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


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


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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread CM Poncelet
Thanks, but I get the following errors:
 
ecalc(182): Error #39, Evaluation stack overflow
    do until tmp = tail

PRESS ANY KEY TO CONTINUE.
 
and
 
Error 10: Illegal ISPEXEC Service 'isredit macro (parm) NOPROCESS'.

PRESS ANY KEY TO CONTINUE.
 
I have CTC Rexx running under DOS - perhaps not the right environment
for this 
 
Cheers, Chris
 


On 27/04/2020 15:29, Robert Prins wrote:
> On 2020-04-24 06:01, CM Poncelet wrote:
>> I attach a Rexx program to calculate and display the biorhythm values
>> for a given date of birth and current or whatever other date.
>
> And if you want to see some niche graphs, try "ecalc
> biog(dd.mm.)", where ecalc can be found (for now) @
> 
>
> Also contains a few other more-or-lesser useful conversions, "ecalc ?"
> will display some help.
>
> Robert

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread CM Poncelet
Yes, you are absolutely right. I thought it was the other way round,
divisble by 100 being leap years and by 400 not leap years.
 
It should have been
  LEAP  = (YEAR-YEAR%4*4=0 & YEAR-YEAR%100*100¬=0 | YEAR-YEAR%400*400=0)
 
This does not affect the calculations themselves, but it does report
incorrectly e.g. that 2000.0229 is not valid.
 
Thanks a lot for pointing this out.
 
Cheers, Chris Poncelet
 
 

On 27/04/2020 10:01, David Crayford wrote:
> FYI, you have a bug with your leap year calculation. You need to check
> if the year is evenly dividable by 100 (which are not leap years
> unless evenly divisible by 400).
>
> isleap: procedure
>   arg year .
>   return (year // 4 = 0 & year // 100 /= 0 ) | year // 400 = 0
>
> On 2020-04-24 2:01 PM, CM Poncelet wrote:
>> I attach a Rexx program to calculate and display the biorhythm values
>> for a given date of birth and current or whatever other date.
>>   If 'management' complains that home workers are not putting enough
>> effort into their working-from-home time, they can run this thing and
>> send its output to 'management' just to prove that they are in perfect
>> working condition and that any slow-down in productivity must be due to
>> external factors which are wholly beyond their control .
>>   Cheers, Chris Poncelet (retired sysprog)
>>
>> --
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread Seymour J Metz
> What I have against (E)TOD is that IEBCOPY got leap seconds wrong
> until they resolved my APAR by converting to TIME.

That's an IEBCOPY issue. If TIME STCKE doesn't do adjustments, then *that* is 
the issue, not ETOD itself. I certainly hope that if IBM starts using ETOD for 
timestamps that they will do so through a documented system interface, not RYO. 
What would be really nice would be if they included both UT* and the zone in 
the new timestamp format.


-- 
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Paul Gilmartin [000433f07816-dmarc-requ...@listserv.ua.edu]
Sent: Monday, April 27, 2020 1:29 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

On Mon, 27 Apr 2020 17:10:54 +, Seymour J Metz wrote:

>> I hope not.
>
>What do you have against ETOD?
>
>> TIME macro
> TIME  STCKE,foo
>
>Or doesn't that do the adjustments?
>
I believe it does not.  I believe TIME LOCAL and TIME GMT do.
I believe STCKCONV and CONVTOD do not.  I am confident
that before TOD rolls over TIME will be using ETOD.

What I have against (E)TOD is that IEBCOPY got leap seconds wrong
until they resolved my APAR by converting to TIME.

And back to David's report on the OP's BIO.TXT.  That uses two
different leap year formulae.  Neither reports an error for 1900.0229.
Rexx DATE() reports an error (though not very lucidly).  The moral
is, "Trust the experts; don't RYO (as IEBCOPY once did)."

-- gil

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

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread Paul Gilmartin
On Mon, 27 Apr 2020 17:10:54 +, Seymour J Metz wrote:

>> I hope not.
>
>What do you have against ETOD?
>
>> TIME macro
> TIME  STCKE,foo
>
>Or doesn't that do the adjustments?
> 
I believe it does not.  I believe TIME LOCAL and TIME GMT do.
I believe STCKCONV and CONVTOD do not.  I am confident
that before TOD rolls over TIME will be using ETOD.

What I have against (E)TOD is that IEBCOPY got leap seconds wrong
until they resolved my APAR by converting to TIME.

And back to David's report on the OP's BIO.TXT.  That uses two
different leap year formulae.  Neither reports an error for 1900.0229.
Rexx DATE() reports an error (though not very lucidly).  The moral
is, "Trust the experts; don't RYO (as IEBCOPY once did)."

-- gil

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread Seymour J Metz
> I hope not.

What do you have against ETOD?

> TIME macro

 TIME  STCKE,foo

Or doesn't that do the adjustments?


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Paul Gilmartin [000433f07816-dmarc-requ...@listserv.ua.edu]
Sent: Monday, April 27, 2020 10:46 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

On 2020-04-27, at 04:57:13, Seymour J Metz wrote:
>
> Is there a statement of direction for using ETOD for all timestamping?
>
I hope not.

I once went to SR because the timestamps in IEBCOPY SYSPRINT were
about 20 seconds ahead of those in job log.  Suggested I suspected
a leap second problem.

Level 1> Whatsa Leap Second?

gil> [lotsa URLs; GIYF]

Level 1> Wow! Thanks!

They fixed it; closure text said they switched to TIME macro --
much better idea than RYO from ETOD, CVTLSO, CVTLDTO, ...


> On 2020-04-27, at 03:41:14, ITschak Mugzach wrote:
>
> צ
>
> בתאריך יום ב׳, 27 באפר׳ 2020, 12:38, מאת David Crayford ...
>
Year 5800/Y6K problem?

-- gil

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

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread Paul Gilmartin
On Mon, 27 Apr 2020 17:01:08 +0800, David Crayford wrote:

>FYI, you have a bug with your leap year calculation. You need to check
>if the year is evenly dividable by 100 (which are not leap years unless
>evenly divisible by 400).
>
>isleap: procedure
>   arg year .
>   return (year // 4 = 0 & year // 100 /= 0 ) | year // 400 = 0
> 
I believe that's taken care of in the OP's code by:
... TRUNC((TRUNC(YY/100)+1)*3/4)

-- gil

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread Paul Gilmartin
On 2020-04-27, at 04:57:13, Seymour J Metz wrote:
> 
> Is there a statement of direction for using ETOD for all timestamping?
>  
I hope not.

I once went to SR because the timestamps in IEBCOPY SYSPRINT were
about 20 seconds ahead of those in job log.  Suggested I suspected
a leap second problem.

Level 1> Whatsa Leap Second?

gil> [lotsa URLs; GIYF]

Level 1> Wow! Thanks!

They fixed it; closure text said they switched to TIME macro --
much better idea than RYO from ETOD, CVTLSO, CVTLDTO, ...


> On 2020-04-27, at 03:41:14, ITschak Mugzach wrote:
> 
> צ
> 
> בתאריך יום ב׳, 27 באפר׳ 2020, 12:38, מאת David Crayford ...
>   
Year 5800/Y6K problem?

-- gil

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread Robert Prins

On 2020-04-24 06:01, CM Poncelet wrote:

I attach a Rexx program to calculate and display the biorhythm values
for a given date of birth and current or whatever other date.


And if you want to see some niche graphs, try "ecalc biog(dd.mm.)", where 
ecalc can be found (for now) @ 


Also contains a few other more-or-lesser useful conversions, "ecalc ?" will 
display some help.


Robert
--
Robert AH Prins
robert.ah.prins(a)gmail.com
The hitchhiking grandfather - https://prino.neocities.org/indez.html
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread Seymour J Metz
Is there a statement of direction for using ETOD for all timestamping?


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
David Crayford [dcrayf...@gmail.com]
Sent: Monday, April 27, 2020 5:37 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

On 2020-04-27 5:18 PM, Ray Pearce wrote:
> Will there be a Y2.1K bug?

I don't know but we've got much bigger problems to solve before then
when the TOD clocks start wrapping :).

Hopefully, I will be retired by then.

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

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread David Crayford
I'll be 71 so I may come out of retirement to earn a few extra quid to 
bump up my pension!


On 2020-04-27 6:07 PM, Ray Pearce wrote:

I'm fairly certain I will retire at some point in the next 22 years.
Can't see me still working at age 87 ;)


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of David Crayford
Sent: 27 April 2020 10:38
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

On 2020-04-27 5:18 PM, Ray Pearce wrote:

Will there be a Y2.1K bug?

I don't know but we've got much bigger problems to solve before then
when the TOD clocks start wrapping :).

Hopefully, I will be retired by then.

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



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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread Ray Pearce
I'm fairly certain I will retire at some point in the next 22 years.
Can't see me still working at age 87 ;)


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of David Crayford
Sent: 27 April 2020 10:38
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

On 2020-04-27 5:18 PM, Ray Pearce wrote:
> Will there be a Y2.1K bug?

I don't know but we've got much bigger problems to solve before then 
when the TOD clocks start wrapping :).

Hopefully, I will be retired by then.

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

-- 
This e-mail message has been scanned and cleared by Google Message Security 
and the UNICOM Global security systems. This message is for the named 
person's use only. If you receive this message in error, please delete it 
and notify the sender. 

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread ITschak Mugzach
צ

בתאריך יום ב׳, 27 באפר׳ 2020, 12:38, מאת David Crayford ‏<
dcrayf...@gmail.com>:

> On 2020-04-27 5:18 PM, Ray Pearce wrote:
> > Will there be a Y2.1K bug?
>
> I don't know but we've got much bigger problems to solve before then
> when the TOD clocks start wrapping :).
>
> Hopefully, I will be retired by then.
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread David Crayford

On 2020-04-27 5:18 PM, Ray Pearce wrote:

Will there be a Y2.1K bug?


I don't know but we've got much bigger problems to solve before then 
when the TOD clocks start wrapping :).


Hopefully, I will be retired by then.

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread Ray Pearce
I guess the code is assuming that the user isn't over 120 years old.

Will there be a Y2.1K bug?

Ray

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of David Crayford
Sent: 27 April 2020 10:01
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

FYI, you have a bug with your leap year calculation. You need to check 
if the year is evenly dividable by 100 (which are not leap years unless 
evenly divisible by 400).

isleap: procedure
   arg year .
   return (year // 4 = 0 & year // 100 /= 0 ) | year // 400 = 0


-- 
This e-mail message has been scanned and cleared by Google Message Security 
and the UNICOM Global security systems. This message is for the named 
person's use only. If you receive this message in error, please delete it 
and notify the sender. 

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


Re: Friday OT, cheerful program for gloomy times

2020-04-27 Thread David Crayford
FYI, you have a bug with your leap year calculation. You need to check 
if the year is evenly dividable by 100 (which are not leap years unless 
evenly divisible by 400).


isleap: procedure
  arg year .
  return (year // 4 = 0 & year // 100 /= 0 ) | year // 400 = 0

On 2020-04-24 2:01 PM, CM Poncelet wrote:

I attach a Rexx program to calculate and display the biorhythm values
for a given date of birth and current or whatever other date.
  
If 'management' complains that home workers are not putting enough

effort into their working-from-home time, they can run this thing and
send its output to 'management' just to prove that they are in perfect
working condition and that any slow-down in productivity must be due to
external factors which are wholly beyond their control .
  
Cheers, Chris Poncelet (retired sysprog)


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


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


Re: Friday OT, cheerful program for gloomy times

2020-04-26 Thread Seymour J Metz
> Mike Cowlishaw created the Rexx language 

Yes, and if you look at the article you linked to, you will see "He has 
contributed to and/or edited various computing standards, including ISO (SGML, 
COBOL, C, C++), BSI (SGML, C), ANSI (REXX), IETF (HTTP 1.0/RFC 1945), W3C (XML 
Schema), ECMA (JavaScript/ECMAScript, C#, CLI), and IEEE (754 decimal 
floating-point). " 

I doubt that he would claim that the standard he worked on was the standard.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of CM 
Poncelet [ponce...@bcs.org.uk]
Sent: Sunday, April 26, 2020 3:30 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

Mike Cowlishaw created the Rexx language 

https://secure-web.cisco.com/1wHB0OokqTuD1qCScSXs4vR7WnmA1aaX4xY-RDe3iultGsGFW_EievpsqsLeqREtY7OMbYCI4fR2vRtHuiJBMAB54rDjknPMMRWKLZDzBB-eUsT5ekPkHDrGpMlAkrnPtHb4VklYeecMBEtsNkV-OBz9Tw5z4tWrAvfP1NnTUbx-unParojR5d0_Xfxp0NaFNp0x760nqXgkUkxzXDDR89eqE4ZdtPnAjD4z0oBAx3sPct9_KvjZEz6kFgU6kbGRXldrUl7ZbMG9Vm0CTdsT9_wMAIt3MO-9efLINUKHCRrn_yp1mQ_KHYBgZzr8pwNsrhpyasbuWzJQ_SI2SIM2xLf87UvB8ks78AYRd-gSbp14-Q-YdaPhLW0iF7Wz-FGyudvxjxyBinuLwPVfO-haEjGKSVJ9Ya0qI-VeF1UKsvbZT_AvDY4XzIUiOBxz9VvJ3/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FMike_Cowlishaw


On 26/04/2020 15:48, Paul Gilmartin wrote:
> On Sun, 26 Apr 2020 07:39:27 +, Seymour J Metz wrote:
>
>> They say that the memory is the second thing to go; I don't remember the 
>> first thing.
>>
>> Given that Mike Cowlishaw was involved in developing ANSI  X3.274-1996, I'm 
>> pretty sure that he would claim that to be the standard Rexx language, just 
>> as I'm pretty sure that John Backus would consider X3.9-1966,  X3.9-1978, 
>> etc., to be standard Fortran, not what ran on the 704.
>>
> I find this akin to expecting all software to follow the antiquated
> MSDOS 8.3 filename format convention.
>
>> 
>> From: CM Poncelet
>> Sent: Saturday, April 25, 2020 11:40 PM
>>
>> "ON NO VALUE" from memory.
>>
> At one time, IBM's Rexx compiler considered SIGNAL ON NOVALUE (sic) a
> syntax error if the label was not supplied.  I think it got better shortly.
>
>> "supports the standard Rexx language" as per Mike Cowlishaw's definition
>> (COW).
>>
>>   Comparison of Built-In Functions
>>
>>  The following table provides a comparison of Built-In Functions
>>  for VM/SP CMS REXX (CMS), M.F. Cowlishaw's definition (COW),
>>  Systems Application Architecture Procedures Language (SAA), and
>>  CTC REXX.
>>
>>  Table 3. Comparison of Built-in Functions
>>
>>
>> Availability of Built-in Functions
>>
>>  FunctionSAA   COW   CMS   CTC
>>...
>> CHARINx x - x
>> CHAROUT   x x - x
>> CHARS x x - x
>> ...
>> DATE  x x x x
>> ...
> But no discussion of supported operand formats.
>
>> LINEINx x - x
>> LINEOUT   x x - x
>>...
>> STREAMx - - x
>>...
> CMS Rexx has supported the *standard* stream I/O for many releases.
>
> Where does one find SAA nowadays.  Mostly, I remember its incursion
> was disruptive by scrambling ISPF's familiar PF key assignments.
>
>>>> See below for the SPF/PC standard Rexx one.
>>>>
> I don't believe SPF/PC governs the standard for either Rexx or Java.
>
>>> DATE('B',foo,'S') is valid in standard Rexx. I don't believe that the first 
>>> and third
>>> parameters are allowed to be longer than 1 character.
>>>
> They're truncated.  Characters beyond the initial are irrelevant.
>
>  
>>> From: CM Poncelet
>>> Sent: Saturday, April 25, 2020 7:10 PM
>>>
>>> Have you checked that your version works, other than on a mainframe?
>>>
> Regina, yes.
>
>>> SPF/PC Rexx supports the standard Rexx language, but not the full IBM
>>> REXX (which includes EXECIO etc.) and it does not recognise your format
>>> of DATE parms. ...
>>>
> SPF/PC, perhaps; standard, no.
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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

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


Re: Friday OT, cheerful program for gloomy times

2020-04-26 Thread CM Poncelet
Mike Cowlishaw created the Rexx language 
 
https://en.wikipedia.org/wiki/Mike_Cowlishaw


On 26/04/2020 15:48, Paul Gilmartin wrote:
> On Sun, 26 Apr 2020 07:39:27 +, Seymour J Metz wrote:
>
>> They say that the memory is the second thing to go; I don't remember the 
>> first thing.
>>
>> Given that Mike Cowlishaw was involved in developing ANSI  X3.274-1996, I'm 
>> pretty sure that he would claim that to be the standard Rexx language, just 
>> as I'm pretty sure that John Backus would consider X3.9-1966,  X3.9-1978, 
>> etc., to be standard Fortran, not what ran on the 704.
>>
> I find this akin to expecting all software to follow the antiquated
> MSDOS 8.3 filename format convention.
>
>> 
>> From: CM Poncelet
>> Sent: Saturday, April 25, 2020 11:40 PM
>>
>> "ON NO VALUE" from memory.
>>
> At one time, IBM's Rexx compiler considered SIGNAL ON NOVALUE (sic) a
> syntax error if the label was not supplied.  I think it got better shortly.
>
>> "supports the standard Rexx language" as per Mike Cowlishaw's definition
>> (COW).
>>
>>   Comparison of Built-In Functions
>>
>>  The following table provides a comparison of Built-In Functions
>>  for VM/SP CMS REXX (CMS), M.F. Cowlishaw's definition (COW),
>>  Systems Application Architecture Procedures Language (SAA), and
>>  CTC REXX.
>>
>>  Table 3. Comparison of Built-in Functions
>>
>>
>> Availability of Built-in Functions
>>
>>  FunctionSAA   COW   CMS   CTC
>>...
>> CHARINx x - x
>> CHAROUT   x x - x
>> CHARS x x - x
>> ...
>> DATE  x x x x
>> ...
> But no discussion of supported operand formats.
>
>> LINEINx x - x
>> LINEOUT   x x - x
>>...   
>> STREAMx - - x
>>...
> CMS Rexx has supported the *standard* stream I/O for many releases.
>
> Where does one find SAA nowadays.  Mostly, I remember its incursion
> was disruptive by scrambling ISPF's familiar PF key assignments.
>
 See below for the SPF/PC standard Rexx one.

> I don't believe SPF/PC governs the standard for either Rexx or Java.
>
>>> DATE('B',foo,'S') is valid in standard Rexx. I don't believe that the first 
>>> and third 
>>> parameters are allowed to be longer than 1 character.
>>>
> They're truncated.  Characters beyond the initial are irrelevant.
>
>  
>>> From: CM Poncelet
>>> Sent: Saturday, April 25, 2020 7:10 PM
>>>
>>> Have you checked that your version works, other than on a mainframe?
>>>
> Regina, yes.
>
>>> SPF/PC Rexx supports the standard Rexx language, but not the full IBM
>>> REXX (which includes EXECIO etc.) and it does not recognise your format
>>> of DATE parms. ...
>>>
> SPF/PC, perhaps; standard, no.
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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


Re: Friday OT, cheerful program for gloomy times

2020-04-26 Thread Paul Gilmartin
On Sun, 26 Apr 2020 07:39:27 +, Seymour J Metz wrote:

>They say that the memory is the second thing to go; I don't remember the first 
>thing.
>
>Given that Mike Cowlishaw was involved in developing ANSI  X3.274-1996, I'm 
>pretty sure that he would claim that to be the standard Rexx language, just as 
>I'm pretty sure that John Backus would consider X3.9-1966,  X3.9-1978, etc., 
>to be standard Fortran, not what ran on the 704.
> 
I find this akin to expecting all software to follow the antiquated
MSDOS 8.3 filename format convention.

>
>From: CM Poncelet
>Sent: Saturday, April 25, 2020 11:40 PM
>
>"ON NO VALUE" from memory.
> 
At one time, IBM's Rexx compiler considered SIGNAL ON NOVALUE (sic) a
syntax error if the label was not supplied.  I think it got better shortly.

>"supports the standard Rexx language" as per Mike Cowlishaw's definition
>(COW).
>
>   Comparison of Built-In Functions
>
>  The following table provides a comparison of Built-In Functions
>  for VM/SP CMS REXX (CMS), M.F. Cowlishaw's definition (COW),
>  Systems Application Architecture Procedures Language (SAA), and
>  CTC REXX.
>
>  Table 3. Comparison of Built-in Functions
>
>
> Availability of Built-in Functions
>
>  FunctionSAA   COW   CMS   CTC
>...
> CHARINx x - x
> CHAROUT   x x - x
> CHARS x x - x
> ...
> DATE  x x x x
> ...
But no discussion of supported operand formats.

> LINEINx x - x
> LINEOUT   x x - x
>...   
> STREAMx - - x
>...
CMS Rexx has supported the *standard* stream I/O for many releases.

Where does one find SAA nowadays.  Mostly, I remember its incursion
was disruptive by scrambling ISPF's familiar PF key assignments.

>>> See below for the SPF/PC standard Rexx one.
>>>
I don't believe SPF/PC governs the standard for either Rexx or Java.

>> DATE('B',foo,'S') is valid in standard Rexx. I don't believe that the first 
>> and third 
>>parameters are allowed to be longer than 1 character.
>>
They're truncated.  Characters beyond the initial are irrelevant.

 
>> From: CM Poncelet
>> Sent: Saturday, April 25, 2020 7:10 PM
>>
>> Have you checked that your version works, other than on a mainframe?
>> 
Regina, yes.

>> SPF/PC Rexx supports the standard Rexx language, but not the full IBM
>> REXX (which includes EXECIO etc.) and it does not recognise your format
>> of DATE parms. ...
>>
SPF/PC, perhaps; standard, no.

-- gil

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


Re: Friday OT, cheerful program for gloomy times

2020-04-26 Thread Seymour J Metz
OREXX in OS/2:

Sun  4-26-20 10:16:16Sun  4-26-20 10:16:16{1}[h:\] H:\$REXX\trynot.cmd
Trying \ 5C
\ recognized
Trying ¬ AA
¬ recognized
Trying ¼ AC
 6 *-* compare = a ¼
 6 *-*   interpret 'compare = a' Not'= b'
REX0013E: Error 13 running H:\$REXX\TRYNOT.CMD line 6:  Invalid character in 
program
REX0219E: Error 13.1:  Incorrect character in program "¼" ('AC'X)

Code pages 437 and 850 have ¬ at AA and ¼ at AC.



--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Joel C. Ewing [jcew...@acm.org]
Sent: Sunday, April 26, 2020 10:03 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

On 4/25/20 3:51 PM, Paul Gilmartin wrote:
> I did not copy-and-paste; I downloaded the attachment,
> which appears to be UTF-8.
>
> For Regina, Regina.pdf says: 3.1.1.1 Negators
> ... Regina supports the following characters as negators:
> ...
> ¬ Logical Not
> Copy-and-paste from the pdf gives me:
> 931 $ printf ¬ | od -tx1
> 000c2  ac
> ... the UTF-8 "¬".  But when I paste it into an EXEC, Regina says:
>  say 2+2 ¬= 4
> Error 13 running "/Users/paulgilm/bin/rxx", line 2: Invalid character in 
> program
> Error 13.1: Invalid character in program "('c2'X)"
>
> I much prefer when the examples in the Ref. actually work.  Does
> ooRexx accept UTF-8 "¬"?
>
> I went on and did something fancy.  Attached.

On  Linux oorexx accepts UTF-8 "¬" , but can't speak for oorexx in M$
environment; and also seems to work for all in Seymour's nots list (Nots
= '\' 'aa'x 'ac'x), but am at a loss to remember context for using
'aa'x as a logical not -- displays as "feminine ordinal indicator" "ª"
in gedit on Linux.

Joel C. Ewing

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

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


Re: Friday OT, cheerful program for gloomy times

2020-04-26 Thread Joel C. Ewing
On 4/25/20 3:51 PM, Paul Gilmartin wrote:
> I did not copy-and-paste; I downloaded the attachment,
> which appears to be UTF-8.
>
> For Regina, Regina.pdf says: 3.1.1.1 Negators
> ... Regina supports the following characters as negators:
> ...
> ¬ Logical Not
> Copy-and-paste from the pdf gives me:
> 931 $ printf ¬ | od -tx1
> 000c2  ac
> ... the UTF-8 "¬".  But when I paste it into an EXEC, Regina says:
>  say 2+2 ¬= 4
> Error 13 running "/Users/paulgilm/bin/rxx", line 2: Invalid character in 
> program
> Error 13.1: Invalid character in program "('c2'X)"
>
> I much prefer when the examples in the Ref. actually work.  Does
> ooRexx accept UTF-8 "¬"?
>
> I went on and did something fancy.  Attached.

On  Linux oorexx accepts UTF-8 "¬" , but can't speak for oorexx in M$
environment; and also seems to work for all in Seymour's nots list (Nots
= '\' 'aa'x 'ac'x), but am at a loss to remember context for using 
'aa'x as a logical not -- displays as "feminine ordinal indicator" "ª"
in gedit on Linux.

Joel C. Ewing

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


Re: Friday OT, cheerful program for gloomy times

2020-04-26 Thread Seymour J Metz
They say that the memory is the second thing to go; I don't remember the first 
thing.

Given that Mike Cowlishaw was involved in developing ANSI  X3.274-1996, I'm 
pretty sure that he would claim that to be the standard Rexx language, just as 
I'm pretty sure that John Backus would consider X3.9-1966,  X3.9-1978, etc., to 
be standard Fortran, not what ran on the 704.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of CM 
Poncelet [ponce...@bcs.org.uk]
Sent: Saturday, April 25, 2020 11:40 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

"ON NO VALUE" from memory.

"supports the standard Rexx language" as per Mike Cowlishaw's definition
(COW).

   Comparison of Built-In Functions

  The following table provides a comparison of Built-In Functions
  for VM/SP CMS REXX (CMS), M.F. Cowlishaw's definition (COW),
  Systems Application Architecture Procedures Language (SAA), and
  CTC REXX.

  Table 3. Comparison of Built-in Functions


 Availability of Built-in Functions

  FunctionSAA   COW   CMS   CTC

 ABBREVx x x x
 ABS   x x x x
 ADDRESS   x x x x
 ARG   x x x x
 BITANDx x x x
 BITOR x x x x
 BITXORx x x x
 B2X   x - - x
 CENTERx x x x
 CHARINx x - x
 CHAROUT   x x - x
 CHARS x x - x
 COMPARE   x x x x
 CONDITION x - - x
 COPIESx x x x
 C2D   x x x x
 C2X   x x x x
 DATATYPE  x x x x
 DATE  x x x x
 DELSTRx x x x
 DELWORD   x x x x
 DIGITSx x x x
 D2C   x x x x
 D2X   x x x x
 ERRORTEXT x x x x
 FORM  x x x x
 FORMATx x x x
 FUZZ  x x x x
 INSERTx x x x
 LASTPOS   x x x x
 LEFT  x x x x
 LENGTHx x x x
 LINEINx x - x
 LINEOUT   x x - x
 LINES x x - x
 MAX   x x x x
 MIN   x x x x
 OVERLAY   x x x x
 POS   x x x x
 QUEUEDx x x x
 RANDOMx x x x
 REVERSE   x x x x
 RIGHT x x x x
 SIGN  x x x x
 SOURCELINEx x x x
 SPACE x x x x
 STREAMx - - x
 STRIP x x x x
 SUBSTRx x x x
 SUBWORD   x x x x
 SYMBOLx x x x
 TIME  x x x x
 TRACE x x x x
 TRANSLATE x x x x
 TRUNC x x x x
 VALUE x x x x
 VERIFYx x x x
 WORD  x x x x
 WORDINDEX x x x x
 WORDLENGTHx x x x
 WORDPOS   x x x x
 WORDS x x x x
 XRANGEx x x x
 X2B   x - - x
 X2C   x x x x
 X2D   x x x x


On 26/04/2020 02:35, Seymour J Metz wrote:
>> After commenting out the &quo

Re: Friday OT, cheerful program for gloomy times

2020-04-25 Thread CM Poncelet
"ON NO VALUE" from memory.
 
"supports the standard Rexx language" as per Mike Cowlishaw's definition
(COW).
 
   Comparison of Built-In Functions

  The following table provides a comparison of Built-In Functions
  for VM/SP CMS REXX (CMS), M.F. Cowlishaw's definition (COW),
  Systems Application Architecture Procedures Language (SAA), and
  CTC REXX.

  Table 3. Comparison of Built-in Functions


 Availability of Built-in Functions

  Function    SAA   COW   CMS   CTC

 ABBREV    x x x x
 ABS   x x x x
 ADDRESS   x x x x
 ARG   x x x x
 BITAND    x x x x
 BITOR x x x x
 BITXOR    x x x x
 B2X   x - - x
 CENTER    x x x x
 CHARIN    x x - x
 CHAROUT   x x - x
 CHARS x x - x
 COMPARE   x x x x
 CONDITION x - - x
 COPIES    x x x x
 C2D   x x x x
 C2X   x x x x
 DATATYPE  x x x x
 DATE  x x x x
 DELSTR    x x x x
 DELWORD   x x x x
 DIGITS    x x x x
 D2C   x x x x
 D2X   x x x x
 ERRORTEXT x x x x
 FORM  x x x x
 FORMAT    x x x x
 FUZZ  x x x x
 INSERT    x x x x
 LASTPOS   x x x x
 LEFT  x x x x
 LENGTH    x x x x
 LINEIN    x x - x
 LINEOUT   x x - x
 LINES x x - x
 MAX   x x x x
 MIN   x x x x
 OVERLAY   x x x x
 POS   x x x x
 QUEUED    x x x x
 RANDOM    x x x x
 REVERSE   x x x x
 RIGHT x x x x
 SIGN  x x x x
 SOURCELINE    x x x x
 SPACE x x x x
 STREAM    x - - x
 STRIP x x x x
 SUBSTR    x x x x
 SUBWORD   x x x x
 SYMBOL    x x x x
 TIME  x x x x
 TRACE x x x x
 TRANSLATE x x x x
 TRUNC x x x x
 VALUE x x x x
 VERIFY    x x x x
 WORD  x x x x
 WORDINDEX x x x x
 WORDLENGTH    x x x x
 WORDPOS   x x x x
 WORDS x x x x
 XRANGE    x x x x
 X2B   x - - x
 X2C   x x x x
 X2D   x x x x


On 26/04/2020 02:35, Seymour J Metz wrote:
>> After commenting out the "SIGNAL ON NO VALUE" 
> "SIGNAL ON NOVALUE" , Shirley.
>
>> SPF/PC Rexx supports the standard Rexx language, 
> Original, but certainly not standard.
>
>> See below for the SPF/PC standard Rexx one.
> DATE('B',foo,'S') is valid in standard Rexx. I don't believe that the first 
> and third parameters are allowed to be longer than 1 character.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
> 
> From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
> CM Poncelet [ponce...@bcs.org.uk]
> Sent: Saturday, April 25, 2020 7:10 PM
> To: IBM-MAIN@LISTSERV.UA

Re: Friday OT, cheerful program for gloomy times

2020-04-25 Thread Seymour J Metz
If you run the code below on oorexx and regina, you will see that they are not 
playing on the same (code) page.

 /* Test whether REXX recognizes all of the logical not characters */
 Nots = '\' 'aa'x 'ac'x
 do 3
parse var Nots Not Nots
say 'Trying' Not c2x(Not)
interpret 'compare = a' Not'= b'
say Not 'recognized'
end



--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Joel C. Ewing [jcew...@acm.org]
Sent: Saturday, April 25, 2020 10:38 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

Always curious about compatibility issues, copied program and pasted
into gedit on Fedora Linux, put a leading
"#!/usr/bin/rexx"  and tried to run with oorexx on linux. Only code
issues found:
(1)Not really a code issue, but had to to run through dos2unix to
convert Windows CR LF end-of-line to unix LF end of line or don't even
get past the unix shebang 1st line -- can't find program "rexx" with CR
appended to name.
(2)Only special characters allowed in variable names in oorexx are !, ?,
and _, so "#DAYS" is not a valid variable name and produced an error
message about unexpected "#".  Find-replace-all "#DAYS" to "NR_DAYS"

That's all it took to get it to run.

Would be nice if non-standard date format of .mmdd were documented
in leading comments, but if you try enough possibilities it does
eventually tell the expected format.  First assuming mm/dd/, I got
that my birthdate was greater than current date, which implies year must
come first.  After assuming ISO -mm-dd, it did get far enough to
tell the date format expected.

Sobering to find I'm over 27,000 days old.
JC Ewing

On 4/24/20 1:01 AM, CM Poncelet wrote:
> I attach a Rexx program to calculate and display the biorhythm values
> for a given date of birth and current or whatever other date.
>
> If 'management' complains that home workers are not putting enough
> effort into their working-from-home time, they can run this thing and
> send its output to 'management' just to prove that they are in perfect
> working condition and that any slow-down in productivity must be due to
> external factors which are wholly beyond their control .
>
> Cheers, Chris Poncelet (retired sysprog)
>
> ...


--
Joel C. Ewing

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

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


Re: Friday OT, cheerful program for gloomy times

2020-04-25 Thread Seymour J Metz
> After commenting out the "SIGNAL ON NO VALUE" 

"SIGNAL ON NOVALUE" , Shirley.

> SPF/PC Rexx supports the standard Rexx language, 

Original, but certainly not standard.

> See below for the SPF/PC standard Rexx one.

DATE('B',foo,'S') is valid in standard Rexx. I don't believe that the first and 
third parameters are allowed to be longer than 1 character.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of CM 
Poncelet [ponce...@bcs.org.uk]
Sent: Saturday, April 25, 2020 7:10 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Friday OT, cheerful program for gloomy times

Have you checked that your version works, other than on a mainframe?

After commenting out the "SIGNAL ON NO VALUE" because it produces a
"LABEL NOT FOUND", I ran it and got:

bio2(50): Error #40, Incorrect call to routine
FACTOR1 = DATE( 'Base', YEAR || MONTH || DAY, 'Standard' )

PRESS ANY KEY TO CONTINUE.

SPF/PC Rexx supports the standard Rexx language, but not the full IBM
REXX (which includes EXECIO etc.) and it does not recognise your format
of DATE parms. See below for the SPF/PC standard Rexx one.

  DATE({option})

   Parameter

  option The format to use to return the date.  The options are:

 B  (Basedate) Returns the number of complete days (not
including the current day) since and including the base
date, January 1, 0001, in the format:  dd (no
leading zeros).  The expression "DATE(B)//7" returns a
number in the range 0-6, where 0 is Monday and 6 is
Sunday.

You can use this option to determine the day of the
week independent of the national language in which you
are working.

Note: The origin of January 1, 0001 is based on the
Gregorian calendar.  Though this calendar did not exist
prior to 1582, Basedate is calculated as if it did:
365 days per year, an extra day every four years except
century years, and leap centuries if the century is
divisible by 400.  It does not take into account any
errors in the calendar system that created the Grego-
rian calendar originally.

 C  (Century) Returns the number of days, including the
current day, so far in this century in the format
'd' (no leading zeros or blanks).

 D  (Days) Returns the number of days, including the
current day, so far in this year in the format 'ddd'
(no leading zeros or blanks).

 E  (European) Returns the date in the format 'dd/mm/yy'.

 J  (Julian) Returns the date in the format 'yyddd', where
'ddd' is the number of days so far in the year.

 L  (Language) Returns the date in the format
'dd month yyy'.

 M  (Month) Returns the full name of the current month, in
mixed case.

 N  (Normal) Explicitly returns the date in the default
format 'dd mmm ', as described above.

 O  (Ordered) Returns the date in the format 'yy/mm/dd'
(suitable for sorting).

 S  (Standard) Returns date in the format 'mmdd' (suit-
able for sorting).  This is one of the three forms
recommended in the International Standards Organization
Recommendation ISO/R 2014-1971 (E).  The other two
forms that document recommends can be derived from this
form by separating the month from the year and day
using either blanks or hyphens, for example:'1989 08
27' or '1989-08-27'.

 U  (USA) Returns the date in the format 'mm/dd/yy'.

 W  (Weekday) Returns the day of the week, in mixed case.

Cheers.


On 25/04/2020 22:27, CM Poncelet wrote:
> Nice one. (BTW My version was not "optimised": it worked and that was
> enough.)
>
> Your NUMERIC DIGITS 8 *might* not be sufficient for your "finite
> difference equation to generate table of sines". I used the much slower
> Taylor series for calculating sines, for which NUMERIC DIGITS 100 worked
> "OK" - but without checking whether this could be reduced to 10 or 8.
>
> Cheers.
>
>
> On 25/04/2020 21:51, Paul Gilmartin wrote:
>> On 2020-04-25, at 08:38:08, Joel C. Ewing wrote:
>>> Always curious about compatibility issues, copied program and pasted
>>> into gedit on Fedora Linux, put a leading
>>> "#!/usr/bin/rexx"  and tried to run with oorexx on linux. Only code
>>> issues found:
>>> (1)Not 

Re: Friday OT, cheerful program for gloomy times

2020-04-25 Thread CM Poncelet
Have you checked that your version works, other than on a mainframe?
 
After commenting out the "SIGNAL ON NO VALUE" because it produces a
"LABEL NOT FOUND", I ran it and got:
 
bio2(50): Error #40, Incorrect call to routine
FACTOR1 = DATE( 'Base', YEAR || MONTH || DAY, 'Standard' )

PRESS ANY KEY TO CONTINUE.
 
SPF/PC Rexx supports the standard Rexx language, but not the full IBM
REXX (which includes EXECIO etc.) and it does not recognise your format
of DATE parms. See below for the SPF/PC standard Rexx one.
 
  DATE({option})

   Parameter

  option The format to use to return the date.  The options are:

 B  (Basedate) Returns the number of complete days (not
    including the current day) since and including the base
    date, January 1, 0001, in the format:  dd (no
    leading zeros).  The expression "DATE(B)//7" returns a
    number in the range 0-6, where 0 is Monday and 6 is
    Sunday.

    You can use this option to determine the day of the
    week independent of the national language in which you
    are working.

    Note: The origin of January 1, 0001 is based on the
    Gregorian calendar.  Though this calendar did not exist
    prior to 1582, Basedate is calculated as if it did:
    365 days per year, an extra day every four years except
    century years, and leap centuries if the century is
    divisible by 400.  It does not take into account any
    errors in the calendar system that created the Grego-
    rian calendar originally.

 C  (Century) Returns the number of days, including the
    current day, so far in this century in the format
    'd' (no leading zeros or blanks).

 D  (Days) Returns the number of days, including the
    current day, so far in this year in the format 'ddd'
    (no leading zeros or blanks).

 E  (European) Returns the date in the format 'dd/mm/yy'.

 J  (Julian) Returns the date in the format 'yyddd', where
    'ddd' is the number of days so far in the year.

 L  (Language) Returns the date in the format
    'dd month yyy'.

 M  (Month) Returns the full name of the current month, in
    mixed case.

 N  (Normal) Explicitly returns the date in the default
    format 'dd mmm ', as described above.

 O  (Ordered) Returns the date in the format 'yy/mm/dd'
    (suitable for sorting).

 S  (Standard) Returns date in the format 'mmdd' (suit-
    able for sorting).  This is one of the three forms
    recommended in the International Standards Organization
    Recommendation ISO/R 2014-1971 (E).  The other two
    forms that document recommends can be derived from this
    form by separating the month from the year and day
    using either blanks or hyphens, for example:'1989 08
    27' or '1989-08-27'.

 U  (USA) Returns the date in the format 'mm/dd/yy'.

 W  (Weekday) Returns the day of the week, in mixed case.
 
Cheers.


On 25/04/2020 22:27, CM Poncelet wrote:
> Nice one. (BTW My version was not "optimised": it worked and that was
> enough.)
>  
> Your NUMERIC DIGITS 8 *might* not be sufficient for your "finite
> difference equation to generate table of sines". I used the much slower
> Taylor series for calculating sines, for which NUMERIC DIGITS 100 worked
> "OK" - but without checking whether this could be reduced to 10 or 8.
>  
> Cheers.
>  
>
> On 25/04/2020 21:51, Paul Gilmartin wrote:
>> On 2020-04-25, at 08:38:08, Joel C. Ewing wrote:
>>> Always curious about compatibility issues, copied program and pasted
>>> into gedit on Fedora Linux, put a leading
>>> "#!/usr/bin/rexx"  and tried to run with oorexx on linux. Only code
>>> issues found:
>>> (1)Not really a code issue, but had to to run through dos2unix to
>>> convert Windows CR LF end-of-line to unix LF end of line or don't even
>>> get past the unix shebang 1st line -- can't find program "rexx" with CR
>>> appended to name.
>>> (2)Only special characters allowed in variable names in oorexx are !, ?,
>>> and _, so "#DAYS" is not a valid variable name and produced an error
>>> message about unexpected "#".  Find-replace-all "#DAYS" to "NR_DAYS"
>>>
>>> That's all it took to get it to run.
>>>  
>> I did not copy-and-paste; I downloaded the attachment,
>> which appears to be UTF-8.
>>
>> For Regina, Regina.pdf says: 3.1.1.1 Negators
>>     ... Regina supports the following characters as negators:
>>     ...
>>     ¬ Logical Not
>> Copy-and-paste from the pdf gives me:
>>     931 $ printf ¬ | od -tx1
>>     000    c2  ac   
>> ... the UTF-8 "¬".  But 

Re: Friday OT, cheerful program for gloomy times

2020-04-25 Thread CM Poncelet
Nice one. (BTW My version was not "optimised": it worked and that was
enough.)
 
Your NUMERIC DIGITS 8 *might* not be sufficient for your "finite
difference equation to generate table of sines". I used the much slower
Taylor series for calculating sines, for which NUMERIC DIGITS 100 worked
"OK" - but without checking whether this could be reduced to 10 or 8.
 
Cheers.
 

On 25/04/2020 21:51, Paul Gilmartin wrote:
> On 2020-04-25, at 08:38:08, Joel C. Ewing wrote:
> >
> > Always curious about compatibility issues, copied program and pasted
> > into gedit on Fedora Linux, put a leading
> > "#!/usr/bin/rexx"  and tried to run with oorexx on linux. Only code
> > issues found:
> > (1)Not really a code issue, but had to to run through dos2unix to
> > convert Windows CR LF end-of-line to unix LF end of line or don't even
> > get past the unix shebang 1st line -- can't find program "rexx" with CR
> > appended to name.
> > (2)Only special characters allowed in variable names in oorexx are !, ?,
> > and _, so "#DAYS" is not a valid variable name and produced an error
> > message about unexpected "#".  Find-replace-all "#DAYS" to "NR_DAYS"
> >
> > That's all it took to get it to run.
> > 
> I did not copy-and-paste; I downloaded the attachment,
> which appears to be UTF-8.
>
> For Regina, Regina.pdf says: 3.1.1.1 Negators
>     ... Regina supports the following characters as negators:
>     ...
>     ¬ Logical Not
> Copy-and-paste from the pdf gives me:
>     931 $ printf ¬ | od -tx1
>     000    c2  ac   
> ... the UTF-8 "¬".  But when I paste it into an EXEC, Regina says:
>  say 2+2 ¬= 4
> Error 13 running "/Users/paulgilm/bin/rxx", line 2: Invalid character
> in program
> Error 13.1: Invalid character in program "('c2'X)"
>
> I much prefer when the examples in the Ref. actually work.  Does
> ooRexx accept UTF-8 "¬"?
>
> I went on and did something fancy.  Attached.
>
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
>
> -- gil
>
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


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


Re: Friday OT, cheerful program for gloomy times

2020-04-25 Thread Paul Gilmartin
On 2020-04-25, at 08:38:08, Joel C. Ewing wrote:
> 
> Always curious about compatibility issues, copied program and pasted
> into gedit on Fedora Linux, put a leading
> "#!/usr/bin/rexx"  and tried to run with oorexx on linux. Only code
> issues found:
> (1)Not really a code issue, but had to to run through dos2unix to
> convert Windows CR LF end-of-line to unix LF end of line or don't even
> get past the unix shebang 1st line -- can't find program "rexx" with CR
> appended to name.
> (2)Only special characters allowed in variable names in oorexx are !, ?,
> and _, so "#DAYS" is not a valid variable name and produced an error
> message about unexpected "#".  Find-replace-all "#DAYS" to "NR_DAYS"
> 
> That's all it took to get it to run.
>  
I did not copy-and-paste; I downloaded the attachment,
which appears to be UTF-8.

For Regina, Regina.pdf says: 3.1.1.1 Negators
... Regina supports the following characters as negators:
...
¬ Logical Not
Copy-and-paste from the pdf gives me:
931 $ printf ¬ | od -tx1
000c2  ac
... the UTF-8 "¬".  But when I paste it into an EXEC, Regina says:
 say 2+2 ¬= 4
Error 13 running "/Users/paulgilm/bin/rxx", line 2: Invalid character in program
Error 13.1: Invalid character in program "('c2'X)"

I much prefer when the examples in the Ref. actually work.  Does
ooRexx accept UTF-8 "¬"?

I went on and did something fancy.  Attached.


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
/*/
/* Calculate Biorhythm Program   */
/*   */
/* Based on theory that physical, emotional and intellectual cycles  */
/* vary from 1.00 to -1.00 every 23, 28 and 33 days from the date of */
/* birth onwards - where positive scores are "up days" and negative  */
/* scores indicate "down days"   */
/*   */
/* Cycles:   */
/* - Physical : 23 days  */
/* - Emotional: 28 days  */
/* - Intellectual : 33 days  */
/*   */
/* Paramters:*/
/* - DATE1  : date of birth  */
/* - DATE2  : current date   */
/* - DEBUG  : to debug this thing, if required   */
/*   */
/*   */
/* 2020/04/04 Chris Poncelet */
/* 2020/04/25 Paul Gilmartin */
/* - Use ASCII operators */
/* - Use Rexx DATE function  */
/* - Streamline modulo arithmetic*/
/* - Use specialized discrete sin() calculation. */
/*/
SIGNAL ON NOVALUE
ARG DATE1 DATE2 DEBUG

IF ABBREV(DEBUG,'D') = 1 THEN ,
  TRACE I

NUMERIC DIGITS 8  /* mmdd  */

/* CHECK THAT START DATE1 IS EARLIER THAN END DATE DATE2 */
IF DATE2 < DATE1 THEN ,
  DO
  SAY 'Start date 'DATE1' must be no later than end date 'DATE2'.'
  SAY ' '
  SAY 'Please try again.'
  SAY ' '
  CALL EXIT
  END /* IF */

/* CHECK THAT DATE1 DATA IS VALID AND WHETHER LEAP YEAR ETC. */
Q = DATE1
CALL CHECK_DATE

/* CONVERT DATE1 YEARS, MONTHS, DAYS TO FACTOR */
FACTOR1 = DATE( 'Base', YEAR || MONTH || DAY, 'Standard' )

/* CALCULATE DAY OF THE WEEK FOR DATE1 */
DAYS = '(Monday) (Tuesday) (Wednesday) (Thursday) (Friday) (Saturday) (Sunday)'
DW1 = WORD( DAYS, FACTOR1 // 7 + 1 )
SAY 'We have year = 'YEAR', month = 'MONTH', day = 'DAY' 'DW1
SAY ' '

/* CHECK THAT DATE2 DATA IS VALID AND WHETHER LEAP YEAR ETC. */
Q = DATE2
CALL CHECK_DATE

/* CONVERT DATE2 YEARS, MONTHS, DAYS TO FACTOR */
FACTOR2 = DATE( 'Base', YEAR || MONTH || DAY, 'Standard' )

/* CALCULATE DAY OF THE WEEK FOR DATE2 */
DW2 = WORD( DAYS, FACTOR2 // 7 + 1 )
SAY 'We have year = 'YEAR', month = 'MONTH', day = 'DAY' 'DW2
SAY ' '


#DAYS = FACTOR2 - FACTOR1
SAY 'Elapsed number of days is '#DAYS
SAY ' '


/* NOW GET PHYSICAL, EMOTIONAL AND INTELLECTUAL CYCLE SCORES */
P =  SINES( 23 #DAYS )
SAY 'Physical  :'FORMAT(P,3,2,0)
SAY

E =  SINES( 28 #DAYS )
SAY 'Emotional :'FORMAT(E,3,2,0)
SAY

I =  SINES( 33 #DAYS )
SAY 'Intellectual  :'FORMAT(I,3,2,0)
SAY

AV = (P+E+I)/3
SAY 'Average   

Re: Friday OT, cheerful program for gloomy times

2020-04-25 Thread CM Poncelet
The attachment was in Windoze's "text document" ANSI format. Not sure
what code page that is other than it's the "UK" one (not pure ASCII.)
When I copied the original BIO.ISP to BIO.txt, all the "¬" (ASCII x'AA')
were changed to "ª" in Windoze. So I replaced all the "¬" with "@" in
SPF/PC then, in Windoze, changed all the "@" back to "¬", which then
stayed shown as "¬"; so I attached that.

On 25/04/2020 07:29, Paul Gilmartin wrote:
> On Sat, 25 Apr 2020 03:15:12 +0100, CM Poncelet wrote:
>
>> "¬" (NOT)
>>
> I inferred as much.  What code page was your attachment?
>
>>> On Fri, 24 Apr 2020 07:01:52 +0100, CM Poncelet wrote:
  ...
 CHECK_DATE:
 /* CHECK THAT DATE IS NUMERIC AND IN THE CORRECT FORMAT */
 IF DATATYPE(Q,N) �= 1 ,
 |  DATATYPE(SUBSTR(Q,1,4),W) �= 1 ,
 |  DATATYPE(SUBSTR(Q,6,4),W) �= 1 ,
 |  LENGTH(Q) �= 9 ,
 |  SUBSTR(Q,5,1) �= '.' THEN ,
...
>>> What charset/CCSID is that supposed to be?
>>>
>>> -- gil
>>>
>>> --
>>> For IBM-MAIN subscribe / signoff / archive access instructions,
>>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>> .
>>>
>>
>> --
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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


Re: Friday OT, cheerful program for gloomy times

2020-04-25 Thread Paul Gilmartin
On Sat, 25 Apr 2020 18:10:25 +1000, Wayne Bickerdike wrote:

>Paul asked:
>
> *What code page was your attachment?*
>
>It's US Code page 37.
>
Is that an EBCDIC code page?  The attachment looks more
like ASCII, or UTF-8.

Blame the editor.  TextEdit fails to show the "¬";  BBEdit fails to show the 
"¬";
vi gets it right.  Go figger.  MIME header in the message shows UTF-8,
but doesn't appear in the attachment.
835 $ locale
...
LC_CTYPE="en_US.UTF-8"

>On Sat, Apr 25, 2020 at 4:30 PM Paul Gilmartin wrote:
>
>> On Sat, 25 Apr 2020 03:15:12 +0100, CM Poncelet wrote:
>>
>> >"¬" (NOT)
>> >
>> I inferred as much.  What code page was your attachment?
>>
>> >> On Fri, 24 Apr 2020 07:01:52 +0100, CM Poncelet wrote:
>> >>>  ...
>> >>> CHECK_DATE:
>> >>> /* CHECK THAT DATE IS NUMERIC AND IN THE CORRECT FORMAT */
>> >>> IF DATATYPE(Q,N) �= 1 ,
>> >>> |  DATATYPE(SUBSTR(Q,1,4),W) �= 1 ,
>> >>> |  DATATYPE(SUBSTR(Q,6,4),W) �= 1 ,
>> >>> |  LENGTH(Q) �= 9 ,
>> >>> |  SUBSTR(Q,5,1) �= '.' THEN ,
>> >>>...
>> >> What charset/CCSID is that supposed to be?

-- gil

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


Re: Friday OT, cheerful program for gloomy times

2020-04-25 Thread Joel C. Ewing
Always curious about compatibility issues, copied program and pasted
into gedit on Fedora Linux, put a leading
"#!/usr/bin/rexx"  and tried to run with oorexx on linux. Only code
issues found:
(1)Not really a code issue, but had to to run through dos2unix to
convert Windows CR LF end-of-line to unix LF end of line or don't even
get past the unix shebang 1st line -- can't find program "rexx" with CR
appended to name.
(2)Only special characters allowed in variable names in oorexx are !, ?,
and _, so "#DAYS" is not a valid variable name and produced an error
message about unexpected "#".  Find-replace-all "#DAYS" to "NR_DAYS"

That's all it took to get it to run.

Would be nice if non-standard date format of .mmdd were documented
in leading comments, but if you try enough possibilities it does
eventually tell the expected format.  First assuming mm/dd/, I got
that my birthdate was greater than current date, which implies year must
come first.  After assuming ISO -mm-dd, it did get far enough to
tell the date format expected. 

Sobering to find I'm over 27,000 days old.
    JC Ewing

On 4/24/20 1:01 AM, CM Poncelet wrote:
> I attach a Rexx program to calculate and display the biorhythm values
> for a given date of birth and current or whatever other date.
>  
> If 'management' complains that home workers are not putting enough
> effort into their working-from-home time, they can run this thing and
> send its output to 'management' just to prove that they are in perfect
> working condition and that any slow-down in productivity must be due to
> external factors which are wholly beyond their control .
>  
> Cheers, Chris Poncelet (retired sysprog)
>
> ...


-- 
Joel C. Ewing

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


Re: Friday OT, cheerful program for gloomy times

2020-04-25 Thread Wayne Bickerdike
Paul asked:

 *What code page was your attachment?*

It's US Code page 37.

On Sat, Apr 25, 2020 at 4:30 PM Paul Gilmartin <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Sat, 25 Apr 2020 03:15:12 +0100, CM Poncelet wrote:
>
> >"¬" (NOT)
> >
> I inferred as much.  What code page was your attachment?
>
> >> On Fri, 24 Apr 2020 07:01:52 +0100, CM Poncelet wrote:
> >>>  ...
> >>> CHECK_DATE:
> >>> /* CHECK THAT DATE IS NUMERIC AND IN THE CORRECT FORMAT */
> >>> IF DATATYPE(Q,N) �= 1 ,
> >>> |  DATATYPE(SUBSTR(Q,1,4),W) �= 1 ,
> >>> |  DATATYPE(SUBSTR(Q,6,4),W) �= 1 ,
> >>> |  LENGTH(Q) �= 9 ,
> >>> |  SUBSTR(Q,5,1) �= '.' THEN ,
> >>>...
> >> What charset/CCSID is that supposed to be?
> >>
> >> -- gil
> >>
> >> --
> >> For IBM-MAIN subscribe / signoff / archive access instructions,
> >> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >> .
> >>
> >
> >
> >--
> >For IBM-MAIN subscribe / signoff / archive access instructions,
> >send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>


-- 
Wayne V. Bickerdike

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


Re: Friday OT, cheerful program for gloomy times

2020-04-25 Thread Paul Gilmartin
On Sat, 25 Apr 2020 03:15:12 +0100, CM Poncelet wrote:

>"¬" (NOT)
> 
I inferred as much.  What code page was your attachment?

>> On Fri, 24 Apr 2020 07:01:52 +0100, CM Poncelet wrote:
>>>  ...
>>> CHECK_DATE:
>>> /* CHECK THAT DATE IS NUMERIC AND IN THE CORRECT FORMAT */
>>> IF DATATYPE(Q,N) �= 1 ,
>>> |  DATATYPE(SUBSTR(Q,1,4),W) �= 1 ,
>>> |  DATATYPE(SUBSTR(Q,6,4),W) �= 1 ,
>>> |  LENGTH(Q) �= 9 ,
>>> |  SUBSTR(Q,5,1) �= '.' THEN ,
>>>...
>> What charset/CCSID is that supposed to be?
>>
>> -- gil
>>
>> --
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>> .
>>
>
>
>--
>For IBM-MAIN subscribe / signoff / archive access instructions,
>send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

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


Re: Friday OT, cheerful program for gloomy times

2020-04-24 Thread Wayne Bickerdike
My wife's BIO had a better intellectual quotient than mine today, however,
she dragged me to the shops today at 8:30 to beat the lockdown rush. They
don't open until 13:00 because it's ANZAC day here. I knew I should have
stayed in bed.

On Sat, Apr 25, 2020 at 2:26 PM Wayne Bickerdike  wrote:

> Never thought about it,  downloaded to Windoze and it looks like this :
>
> IF DATE2 ¬> DATE1 THEN
>
> CCSID, bah!
>
> On Sat, Apr 25, 2020 at 12:18 PM CM Poncelet  wrote:
>
>> Technical support suggests that you try changing your date of birth, to
>> see whether that fixes the problem.
>>
>> On 25/04/2020 00:16, Wayne Bickerdike wrote:
>> > All negatives for me today. Plus I'm thousands of days old :(
>> >
>> > On Sat, Apr 25, 2020 at 6:21 AM scott Ford  wrote:
>> >
>> >> Nice Chris, at least you have a job, I got furloughed ...
>> >>
>> >>
>> >>
>> >>
>> >> On Fri, Apr 24, 2020 at 2:01 AM CM Poncelet 
>> wrote:
>> >>
>> >>> I attach a Rexx program to calculate and display the biorhythm values
>> >>> for a given date of birth and current or whatever other date.
>> >>>
>> >>> If 'management' complains that home workers are not putting enough
>> >>> effort into their working-from-home time, they can run this thing and
>> >>> send its output to 'management' just to prove that they are in perfect
>> >>> working condition and that any slow-down in productivity must be due
>> to
>> >>> external factors which are wholly beyond their control .
>> >>>
>> >>> Cheers, Chris Poncelet (retired sysprog)
>> >>>
>> >>> --
>> >>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> >>> send email to lists...@listserv.ua.edu with the message: INFO
>> IBM-MAIN
>> >>>
>> >> --
>> >> Scott Ford
>> >> IDMWORKS
>> >> z/OS Development
>> >>
>> >> --
>> >> For IBM-MAIN subscribe / signoff / archive access instructions,
>> >> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>> >>
>> >
>>
>> --
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>
>
>
> --
> Wayne V. Bickerdike
>
>

-- 
Wayne V. Bickerdike

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


Re: Friday OT, cheerful program for gloomy times

2020-04-24 Thread Wayne Bickerdike
Never thought about it,  downloaded to Windoze and it looks like this :

IF DATE2 ¬> DATE1 THEN

CCSID, bah!

On Sat, Apr 25, 2020 at 12:18 PM CM Poncelet  wrote:

> Technical support suggests that you try changing your date of birth, to
> see whether that fixes the problem.
>
> On 25/04/2020 00:16, Wayne Bickerdike wrote:
> > All negatives for me today. Plus I'm thousands of days old :(
> >
> > On Sat, Apr 25, 2020 at 6:21 AM scott Ford  wrote:
> >
> >> Nice Chris, at least you have a job, I got furloughed ...
> >>
> >>
> >>
> >>
> >> On Fri, Apr 24, 2020 at 2:01 AM CM Poncelet 
> wrote:
> >>
> >>> I attach a Rexx program to calculate and display the biorhythm values
> >>> for a given date of birth and current or whatever other date.
> >>>
> >>> If 'management' complains that home workers are not putting enough
> >>> effort into their working-from-home time, they can run this thing and
> >>> send its output to 'management' just to prove that they are in perfect
> >>> working condition and that any slow-down in productivity must be due to
> >>> external factors which are wholly beyond their control .
> >>>
> >>> Cheers, Chris Poncelet (retired sysprog)
> >>>
> >>> --
> >>> For IBM-MAIN subscribe / signoff / archive access instructions,
> >>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >>>
> >> --
> >> Scott Ford
> >> IDMWORKS
> >> z/OS Development
> >>
> >> --
> >> For IBM-MAIN subscribe / signoff / archive access instructions,
> >> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >>
> >
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>


-- 
Wayne V. Bickerdike

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


Re: Friday OT, cheerful program for gloomy times

2020-04-24 Thread CM Poncelet
Technical support suggests that you try changing your date of birth, to
see whether that fixes the problem.

On 25/04/2020 00:16, Wayne Bickerdike wrote:
> All negatives for me today. Plus I'm thousands of days old :(
>
> On Sat, Apr 25, 2020 at 6:21 AM scott Ford  wrote:
>
>> Nice Chris, at least you have a job, I got furloughed ...
>>
>>
>>
>>
>> On Fri, Apr 24, 2020 at 2:01 AM CM Poncelet  wrote:
>>
>>> I attach a Rexx program to calculate and display the biorhythm values
>>> for a given date of birth and current or whatever other date.
>>>
>>> If 'management' complains that home workers are not putting enough
>>> effort into their working-from-home time, they can run this thing and
>>> send its output to 'management' just to prove that they are in perfect
>>> working condition and that any slow-down in productivity must be due to
>>> external factors which are wholly beyond their control .
>>>
>>> Cheers, Chris Poncelet (retired sysprog)
>>>
>>> --
>>> For IBM-MAIN subscribe / signoff / archive access instructions,
>>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>>
>> --
>> Scott Ford
>> IDMWORKS
>> z/OS Development
>>
>> --
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>
>

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


Re: Friday OT, cheerful program for gloomy times

2020-04-24 Thread CM Poncelet
"¬" (NOT)

On 25/04/2020 02:18, Paul Gilmartin wrote:
> On Fri, 24 Apr 2020 07:01:52 +0100, CM Poncelet wrote:
>
>> I attach a Rexx program to calculate and display the biorhythm values
>> for a given date of birth and current or whatever other date.
>>  
>> If 'management' complains that home workers are not putting enough
>> effort into their working-from-home time, they can run this thing and
>> send its output to 'management' just to prove that they are in perfect
>> working condition and that any slow-down in productivity must be due to
>> external factors which are wholly beyond their control .
>>  ...
>> CHECK_DATE:
>> /* CHECK THAT DATE IS NUMERIC AND IN THE CORRECT FORMAT */
>> IF DATATYPE(Q,N) �= 1 ,
>> |  DATATYPE(SUBSTR(Q,1,4),W) �= 1 ,
>> |  DATATYPE(SUBSTR(Q,6,4),W) �= 1 ,
>> |  LENGTH(Q) �= 9 ,
>> |  SUBSTR(Q,5,1) �= '.' THEN ,
>>...
> What charset/CCSID is that supposed to be?
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>


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


Re: Friday OT, cheerful program for gloomy times

2020-04-24 Thread Paul Gilmartin
On Fri, 24 Apr 2020 07:01:52 +0100, CM Poncelet wrote:

>I attach a Rexx program to calculate and display the biorhythm values
>for a given date of birth and current or whatever other date.
> 
>If 'management' complains that home workers are not putting enough
>effort into their working-from-home time, they can run this thing and
>send its output to 'management' just to prove that they are in perfect
>working condition and that any slow-down in productivity must be due to
>external factors which are wholly beyond their control .
> ...
>CHECK_DATE:
>/* CHECK THAT DATE IS NUMERIC AND IN THE CORRECT FORMAT */
>IF DATATYPE(Q,N) �= 1 ,
>|  DATATYPE(SUBSTR(Q,1,4),W) �= 1 ,
>|  DATATYPE(SUBSTR(Q,6,4),W) �= 1 ,
>|  LENGTH(Q) �= 9 ,
>|  SUBSTR(Q,5,1) �= '.' THEN ,
>...
What charset/CCSID is that supposed to be?

-- gil

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


Re: Friday OT, cheerful program for gloomy times

2020-04-24 Thread Wayne Bickerdike
Anything with date algorithms floats my boat. Another lot to add to my
list. Thanks!

On Sat, Apr 25, 2020 at 9:16 AM Wayne Bickerdike  wrote:

> All negatives for me today. Plus I'm thousands of days old :(
>
> On Sat, Apr 25, 2020 at 6:21 AM scott Ford  wrote:
>
>> Nice Chris, at least you have a job, I got furloughed ...
>>
>>
>>
>>
>> On Fri, Apr 24, 2020 at 2:01 AM CM Poncelet  wrote:
>>
>> > I attach a Rexx program to calculate and display the biorhythm values
>> > for a given date of birth and current or whatever other date.
>> >
>> > If 'management' complains that home workers are not putting enough
>> > effort into their working-from-home time, they can run this thing and
>> > send its output to 'management' just to prove that they are in perfect
>> > working condition and that any slow-down in productivity must be due to
>> > external factors which are wholly beyond their control .
>> >
>> > Cheers, Chris Poncelet (retired sysprog)
>> >
>> > --
>> > For IBM-MAIN subscribe / signoff / archive access instructions,
>> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>> >
>> --
>> Scott Ford
>> IDMWORKS
>> z/OS Development
>>
>> --
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>
>
>
> --
> Wayne V. Bickerdike
>
>

-- 
Wayne V. Bickerdike

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


Re: Friday OT, cheerful program for gloomy times

2020-04-24 Thread Wayne Bickerdike
All negatives for me today. Plus I'm thousands of days old :(

On Sat, Apr 25, 2020 at 6:21 AM scott Ford  wrote:

> Nice Chris, at least you have a job, I got furloughed ...
>
>
>
>
> On Fri, Apr 24, 2020 at 2:01 AM CM Poncelet  wrote:
>
> > I attach a Rexx program to calculate and display the biorhythm values
> > for a given date of birth and current or whatever other date.
> >
> > If 'management' complains that home workers are not putting enough
> > effort into their working-from-home time, they can run this thing and
> > send its output to 'management' just to prove that they are in perfect
> > working condition and that any slow-down in productivity must be due to
> > external factors which are wholly beyond their control .
> >
> > Cheers, Chris Poncelet (retired sysprog)
> >
> > --
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >
> --
> Scott Ford
> IDMWORKS
> z/OS Development
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>


-- 
Wayne V. Bickerdike

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


Re: Friday OT, cheerful program for gloomy times

2020-04-24 Thread scott Ford
Nice Chris, at least you have a job, I got furloughed ...




On Fri, Apr 24, 2020 at 2:01 AM CM Poncelet  wrote:

> I attach a Rexx program to calculate and display the biorhythm values
> for a given date of birth and current or whatever other date.
>
> If 'management' complains that home workers are not putting enough
> effort into their working-from-home time, they can run this thing and
> send its output to 'management' just to prove that they are in perfect
> working condition and that any slow-down in productivity must be due to
> external factors which are wholly beyond their control .
>
> Cheers, Chris Poncelet (retired sysprog)
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
-- 
Scott Ford
IDMWORKS
z/OS Development

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


Friday OT, cheerful program for gloomy times

2020-04-24 Thread CM Poncelet
I attach a Rexx program to calculate and display the biorhythm values
for a given date of birth and current or whatever other date.
 
If 'management' complains that home workers are not putting enough
effort into their working-from-home time, they can run this thing and
send its output to 'management' just to prove that they are in perfect
working condition and that any slow-down in productivity must be due to
external factors which are wholly beyond their control .
 
Cheers, Chris Poncelet (retired sysprog)

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
/*/
/* Calculate Biorhythm Program   */
/*   */
/* Based on theory that physical, emotional and intellectual cycles  */
/* vary from 1.00 to -1.00 every 23, 28 and 33 days from the date of */
/* birth onwards - where positive scores are "up days" and negative  */
/* scores indicate "down days"   */
/*   */
/* Cycles:   */
/* - Physical : 23 days  */
/* - Emotional: 28 days  */
/* - Intellectual : 33 days  */
/*   */
/* Paramters:*/
/* - DATE1  : date of birth  */
/* - DATE2  : current date   */
/* - DEBUG  : to debug this thing, if required   */
/*   */
/*   */
/* 2020/04/04 Chris Poncelet */
/*/
ARG DATE1 DATE2 DEBUG

IF ABBREV(DEBUG,'D') = 1 THEN ,
  TRACE I

NUMERIC DIGITS 100

/* CHECK THAT START DATE1 IS EARLIER THAN END DATE DATE2 */
IF DATE2 ¬> DATE1 THEN ,
  DO
  SAY 'START DATE 'DATE1' MUST BE EARLIER THAN END DATE 'DATE2'.'
  SAY ' '
  SAY 'PLEASE TRY AGAIN.'
  SAY ' '
  CALL EXIT
  END /* IF */

/* CHECK THAT DATE1 DATA IS VALID AND WHETHER LEAP YEAR ETC. */
Q = DATE1
CALL CHECK_DATE

/* CONVERT DATE1 YEARS, MONTHS, DAYS TO FACTOR */
CALL GET_FACTOR
FACTOR1 = FACTOR

/* CALCULATE DAY OF THE WEEK FOR DATE1 */
DW1 = FACTOR + TRUNC(-FACTOR/7)*7
SELECT
  WHEN DW1 = 0 THEN DW1 = '(SATURDAY)'
  WHEN DW1 = 1 THEN DW1 = '(SUNDAY)'
  WHEN DW1 = 2 THEN DW1 = '(MONDAY)'
  WHEN DW1 = 3 THEN DW1 = '(TUESDAY)'
  WHEN DW1 = 4 THEN DW1 = '(WEDNESDAY)'
  WHEN DW1 = 5 THEN DW1 = '(THURSDAY)'
  WHEN DW1 = 6 THEN DW1 = '(FRIDAY)'
  OTHERWISE NOP
  END /* SELECT */
SAY 'WE HAVE YEAR = 'YEAR', MONTH = 'MONTH', DAY = 'DAY' 'DW1
SAY ' '

/* CHECK THAT DATE2 DATA IS VALID AND WHETHER LEAP YEAR ETC. */
Q = DATE2
CALL CHECK_DATE

/* CONVERT DATE2 YEARS, MONTHS, DAYS TO FACTOR */
CALL GET_FACTOR
FACTOR2 = FACTOR

/* CALCULATE DAY OF THE WEEK FOR DATE2 */
DW2 = FACTOR + TRUNC(-FACTOR/7)*7
SELECT
  WHEN DW2 = 0 THEN DW2 = '(SATURDAY)'
  WHEN DW2 = 1 THEN DW2 = '(SUNDAY)'
  WHEN DW2 = 2 THEN DW2 = '(MONDAY)'
  WHEN DW2 = 3 THEN DW2 = '(TUESDAY)'
  WHEN DW2 = 4 THEN DW2 = '(WEDNESDAY)'
  WHEN DW2 = 5 THEN DW2 = '(THURSDAY)'
  WHEN DW2 = 6 THEN DW2 = '(FRIDAY)'
  OTHERWISE NOP
  END /* SELECT */
SAY 'WE HAVE YEAR = 'YEAR', MONTH = 'MONTH', DAY = 'DAY' 'DW2
SAY ' '


#DAYS = FACTOR2 - FACTOR1
SAY 'ELAPSED NUMBER OF DAYS IS '#DAYS
SAY ' '

/* NOW GET PHYSICAL, EMOTIONAL AND INTELLECTUAL CYCLE SCORES */
Q = #DAYS/23
CALL GET_SINE
P = QS
IF P < 0 THEN ,
  SAY 'PHYSICAL  : 'FORMAT(QS,,2)
ELSE,
  SAY 'PHYSICAL  :  'FORMAT(QS,,2)
SAY ' '

Q = #DAYS/28
CALL GET_SINE
E = QS
IF E < 0 THEN ,
  SAY 'EMOTIONAL : 'FORMAT(QS,,2)
ELSE ,
  SAY 'EMOTIONAL :  'FORMAT(QS,,2)
SAY ' '

Q = #DAYS/33
CALL GET_SINE
I = QS
IF I < 0 THEN ,
  SAY 'INTELLECTUAL  : 'FORMAT(QS,,2)
ELSE ,
  SAY 'INTELLECTUAL  :  'FORMAT(QS,,2)
SAY ' '

AV = (P+E+I)/3
IF AV < 0 THEN ,
  SAY 'AVERAGE   : 'FORMAT(AV,,2)
ELSE ,
  SAY 'AVERAGE   :  'FORMAT(AV,,2)
SAY ' '

CALL EXIT


/*/
/* SUBROUTINES   */
/*/


CHECK_DATE:
/* CHECK THAT DATE IS NUMERIC AND IN THE CORRECT FORMAT */
IF DATATYPE(Q,N) ¬= 1 ,
|  DATATYPE(SUBSTR(Q,1,4),W) ¬= 1 ,
|  DATATYPE(SUBSTR(Q,6,4),W) ¬= 1 ,
|  LENGTH(Q) ¬= 9 ,
|  SUBSTR(Q,5,1) ¬= '.' THEN ,
  DO
  SAY '"'Q'"' 'MUST BE NUMERIC IN THE FORM