Again, why not query system symbol &LWDAY, instead of trying to calculate?
https://www.ibm.com/docs/en/zos/3.1.0?topic=1-operation
Here is some sample code from IBM that could be used as a starting point, and
likely simplified
Set up the area that is to contain the substitution text. The caller does not
provide a symbol table or time stamp.
LA 3,MYSYMBP
USING SYMBP,3
XC SYMBP(SYMBP_LEN),SYMBP Initialize to zero
LA 4,PATTERN Address of pattern
ST 4,SYMBPPATTERN@ Save in SYMBP area
LA 4,L'PATTERN Length of pattern
ST 4,SYMBPPATTERNLENGTH Save in SYMBP area
LA 4,TARGET Address of target
ST 4,SYMBPTARGET@ Save in SYMBP area
MVC TARGETLENGTH,=A(L'TARGET) Set length of target
LA 4,TARGETLENGTH Address of target length
ST 4,SYMBPTARGETLENGTH@ Save in SYMBP area
*
* Because the caller did not provide a symbol table, we know that
* we are using only the system symbols provided by MVS. Since we have
* initialized the entire SYMBP area to 0, we do not have to
* set up the SYMBPSYMBOLTABLE@ field.
*
* Because the caller did not provide a timestamp, and because we
* have initialized the entire SYMBP area to 0, we do not have to
* set up the SYMBPTIMESTAMP@ field.
*
LA 4,RETURNCODE Address of return code
ST 4,SYMBPRETURNCODE@ Save in SYMBP area
DROP 3
⋮
*
* Note that to avoid the assembler substituting
* for &SYSNAME, &YYMMDD, &HHMMSS, two ampersands are specified.
* The resulting pattern, then, is actually
* USERID.&SYSNAME..D&YYMMDD..T&HHMMSS
*
PATTERN DC C'USERID.&&SYSNAME..D&&YYMMDD..T&&HHMMSS'
DYNAREA DSECT
DS 0F
MYSYMBP DS CL(SYMBP_LEN) SYMBP area
RETURNCODE DS F Return code
TARGETLENGTH DS F Length of target
TARGET DS CL80 An area big enough to hold the target no
* matter what is substituted. Since &DATE
* and &TIME are not used, it need be no
* longer than the pattern area.
ASASYMBP , Mapping of SYMBP area
Dave Jousma
Vice President | Director, Technology Engineering
From: IBM Mainframe Discussion List <[email protected]> on behalf of
David Spiegel <[email protected]>
Date: Friday, April 18, 2025 at 11:03 AM
To: [email protected] <[email protected]>
Subject: Re: Day of week from a program
Hi Ituriel,
Please send me a copy to [email protected]
Thanks and regards,
David
On 2025-04-18 10:25, Ituriel do Neto wrote:
> Hello,
>
> I do have a very old assembler macro that returns the day of the week when
> the date (DDMMCCYY) is passed. Please let me know if you want it.
>
>
> Best Regards
>
> Ituriel do Nascimento Neto
> z/OS System Programmer
>
>
>
>
>
>
> Em quinta-feira, 17 de abril de 2025 às 20:31:59 GMT+2, Paul Gilmartin
> <[email protected]> escreveu:
>
>
>
>
>
> On Thu, 17 Apr 2025 18:54:28 +0200, salva wrote:
>
>> So, remember to add CVTLSO to the STCK value if needed. Also, CVTLDTO for
>> local time.
>>
> Those suffice for only the present time. The better an answer,
> which IBM inexplicably shuns, although it's used by nearly all
> mobile and desktop devices is:
> <https://urldefense.com/v3/__https://www.iana.org/time-zones__;!!MwwqYLOC6b6whF7V!nTQebB8T-IS9RUqyk60saSTSZL2BMUgh60QOXesjk6nAuowOO_0_CEfaeVpBwLbhsJWfO0E75jMl3cWkFnLMeTo5haaPwqPB7z0$<https://urldefense.com/v3/__https:/www.iana.org/time-zones__;!!MwwqYLOC6b6whF7V!nTQebB8T-IS9RUqyk60saSTSZL2BMUgh60QOXesjk6nAuowOO_0_CEfaeVpBwLbhsJWfO0E75jMl3cWkFnLMeTo5haaPwqPB7z0$>>
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
This e-mail transmission contains information that is confidential and may be
privileged. It is intended only for the addressee(s) named above. If you
receive this e-mail in error, please do not read, copy or disseminate it in any
manner. If you are not the intended recipient, any disclosure, copying,
distribution or use of the contents of this information is prohibited. Please
reply to the message immediately by informing the sender that the message was
misdirected. After replying, please erase it from your computer system. Your
assistance in correcting this error is appreciated.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN