|
This is a snippet from a procedure, which uses the CEEDYWK API: *------------------------------------------------------------------------- * yDayOfWeek returns the day of the week (1=Sunday, . . 7=Saturday) *------------------------------------------------------------------------- yDayOfWeek B Export * Procedure interface yDayOfWeek PI 1S 0 p$InDate D Const DatFmt(*ISO) * * BaseDate is the day the calendar changed BaseDate S D Inz(D'1582-10-14') Static nDayOfWeek S 10I 0 Static nDays S 10I 0 r$Day S 1S 0 *---------------------------------------------------------------* /free Test(E) p$InDate; If %error; Return -1; EndIf; nDays = %diff(p$InDate:BaseDate:*D); CallP CEEDYWK(nDays:nDayOfweek); r$Day = nDayOfWeek; Return r$Day; /end-free P yDayOfWeek E Regards, Werner Noll -----Ursprüngliche Nachricht----- Von: akhan@xxxxxxxxxxxxxxxxxx [mailto:akhan@xxxxxxxxxxxxxxxxxx] Gesendet: Montag, 3. Mai 2004 10:21 An: rpg400-l@xxxxxxxxxxxx Betreff: Need to know Day of any Date HI, I need to know Day of any transaction date. My transaction date 8,0 numeric (yyyymmdd format), RPG *DAY code gives me current Job's Day in numeric value but I need Day of any given date and like to know Day as SAT,SUN,MON etc. Please help me how to get it in simple way. Regard. Amir Raza Khan _______________________________________________ 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-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.