|
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
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.