|
If you have TAATOOLS you can do: In a CL do the command RTVDAT3 Retrieve Date 3 - TAA (RTVDAT3) Type choices, press Enter. Label . . . . . . . . . . . . . Day of the week . . . . . . . . > &DAYWK 1-7, *SUN, *MON, *TUE... Month . . . . . . . . . . . . . > &MONTH 1-12, *JAN, *FEB, *MAR... Relative day of month . . . . . > &RELDAY 1-5, *LAST Year . . . . . . . . . . . . . . > *CURRENT 1940-2039, *CURRENT Return date as CYYMMDD (7) > &DATE Character value Comment . . . . . . . . . . . . You can create a CL passing in the first 3 variables (&DAYWK, &MONTH and &RELDAY) &DAYWK = 1 thru 7 (Sun being 1) or *SUN, *MON, etc. &MONTH = 1 thru 12 or *JAN, *FEB, etc. &RELDAY = 1 thru 5 or *last. If you use 1 it will give you the first Monday of the month, 2 the second Monday etc. *last will give you the last day of the month. The &DATE return value is the date in CYYMMDD. You can then take this date and convert it to MDY, JUL, YMD, whatever. Convert Date (CVTDAT) Type choices, press Enter. Label . . . . . . . . . . . . . Date to be converted . . . . . . > &DATE Character value CL var for converted date . . . > &MDY Character value From date format . . . . . . . . > *CYMD *SYSVAL, *MDY, *DMY, *YMD... To date format . . . . . . . . . > *MDY *SYSVAL, *MDY, *DMY, *YMD... To date separator . . . . . . . > *NONE *SYSVAL, *NONE, *JOB... Comment . . . . . . . . . . . . I hope this helps you. Jim Rubino Senior Business Systems Analyst FIKE CORPORATION 704 South 10th Street Blue Springs, Mo.? 64013 (816)?229-6216? Ext. 213 ? -----Original Message----- From: fkany@xxxxxxxxxxxxxxxxxx [mailto:fkany@xxxxxxxxxxxxxxxxxx] Sent: Wednesday, March 05, 2003 2:16 PM To: rpg400-l@xxxxxxxxxxxx Subject: calculate first monday or working day Anyone have any code or formula that will calculate the first monday or first working day of the month for any given year? TIA, Frank _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.