|
Quazy, Using RPG400 built-in as jpcarr suggests is best. But if you are compelled to do it in CL then here's something we used prior to RPG400. PGM PARM(&DATE) DCL VAR(&DATE) TYPE(*CHAR) LEN(6) DCL VAR(&JULDAT) TYPE(*CHAR) LEN(5) DCL VAR(&DAYN) TYPE(*DEC) LEN(3) DCL VAR(&DAYA) TYPE(*CHAR) LEN(3) DCL VAR(&YRN) TYPE(*DEC) LEN(3) DCL VAR(&YRA) TYPE(*CHAR) LEN(2) CVTDAT DATE(&DATE) TOVAR(&JULDAT) TOFMT(*JUL) + TOSEP(*NONE) CHGVAR &DAYN %SST(&JULDAT 3 3) CHGVAR &DAYN (&DAYN - 1) IF (&DAYN = 0) DO CHGVAR &YRN %SST(&JULDAT 1 2) /* Y1.00 Set to Y2K */ IF COND(&YRN = 00) THEN(CHGVAR VAR(&YRN) VALUE(100)) CHGVAR &YRN (&YRN - 1) CHGVAR &YRA &YRN CHGVAR &DATE ('3112' *CAT &YRA) CVTDAT DATE(&DATE) TOVAR(&DATE) FROMFMT(*DMY) + TOFMT(*SYSVAL) TOSEP(*NONE) ENDDO ELSE DO CHGVAR &DAYA &DAYN CHGVAR %SST(&JULDAT 3 3) &DAYA CVTDAT DATE(&JULDAT) TOVAR(&DATE) FROMFMT(*JUL) + TOFMT(*SYSVAL) TOSEP(*NONE) ENDDO ENDPGM Cheers, Peter -----Original Message----- From: Quazy [mailto:quazy@SoftHome.net] Sent: Tuesday, June 27, 2000 7:43 AM To: RPG400-L@midrange.com Subject: Yesterdays date I am looking for a free utility or program that will give me yesterdays date. I was wondering if someone out there has written such a thing that they would be willing to share. I can do this myself but it is a pain to check for leap year and stuff, I just didn't want to re-invent the wheel if it is already out there. Thanks ********************************************************************************************************** Privileged / Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and please notify us immediately. Please advise immediately if you or your employer does not consent to Internet e-mail for messages of this kind. Opinions and other information expressed in this message are not given or endorsed by my firm or employer unless otherwise indicated by an authorised representative independent of this message. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.