× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



AAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHH
Thanks Robert, that was it
Im embarrassed to say how long I have been looking at this

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Robert Rogerson
Sent: Wednesday, August 19, 2020 9:41 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] Re: problem with DAYOFWEEK_ISO in an SQLRPGLE program

Shouldn't Beginning_of_Next_Month be a host variable? You're missing the colon?

exec sql
select DayOfWeek_ISO( *:*Beginning_of_Next_Month)
into :HldDayOfWeek_ISO
FROM SYSIBM.SYSDUMMY1;

Rob

On Wed, Aug 19, 2020 at 9:33 AM Alan Shore via RPG400-L < rpg400-l@xxxxxxxxxxxxxxxxxx> wrote:

Hi everyone
We are on V7r3
I am trying to determine the first business day of the following month
I have a simple program to start of with It takes a date, calculates
the first of the following month, and then finds the day of the week
(ISO) The code is below (like I said - its simple) Using debug, I can
see that HldDayOfWeek_ISO from
DayOfWeek_ISO(Beginning_of_Next_Month) is zero (which is NOT a correct
value)
But HldDayOfWeek_ISO2 from DAYOFWEEK_ISO(CURRENT_DATE) is 3 - which is
correct - today being Wednesday
***NOTE*** - The value of Beginning_Of_Next_month is '2019-02-01' ,
according to debug Can anyone see what is wrong with this code?
Why I am not getting the DAYOFWEEK_ISO for Beginning_Of_Next_Month?
As always, all answers replies gratefully accepted

dcl-s MyDate date
inz(d'2019-01-02');
dcl-s Beginning_of_Next_Month date;
dcl-s HldDayOfWeek_ISO zoned(2:0);
dcl-s HldDayOfWeek_ISO2 zoned(2:0);

//-------------------------------------------------------------------
// Stand Alone Fields - BOTTOM
//-------------------------------------------------------------------
exec Sql Set Option Commit=*NC, CLOSQLCSR=*ENDMOD, DECMPT=*PERIOD;
exec Sql Set Option DATFMT = *ISO, NAMING = *SQL;

Beginning_of_Next_Month = MyDate - %Days(%subdt( myDate:*days)-1) +
%months(1) ;
exec sql
select DayOfWeek_ISO(Beginning_of_Next_Month)
into :HldDayOfWeek_ISO
FROM SYSIBM.SYSDUMMY1;

exec sql
SELECT DAYOFWEEK_ISO(CURRENT_DATE)
INTO :HldDayOfWeek_ISO2 FROM SYSIBM.SYSDUMMY1;

*inlr = '1';
return;

Alan Shore
E-mail : ASHORE@xxxxxxxx<mailto:ASHORE@xxxxxxxx>
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.