REXX Tips & Tricks, Version 2.80


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


DsDate - Date function


Name     DsDATE - date function 
Version  9/1995
Author   Dan Statkus 
         (see EMail Addresses)
Distrib. Freeware 
Type     REXX routine 
Price    -
Source   BBS 
         Name: DSDATE.* 

Description of the author: 
"dsDate provides enhancements to all switches of the DATE() function 
provided by REXX/2, and also provides additional date switches. 
The dsDate function emulates ALL of the switches of the native REXX/2 
DATE() function. dsDate() solves the following anamolies of the REXX/2 
native function: 
   1. DATE() only returns data concerning the current system date. 
      dsDate() allows you to specify ANY date and obtain the same 
      information using the same optional parameters used by DATE(). If 
      you do not provide a date, then (by default) dsDate() will act on 
      the current system date.  See examples. 
   2. DATE() will generate a runtime error if you attempt to use either 
      the 'C' or 'J' switches in native OS/2. Personal Rexx must be 
      available in order for these switches to function. dsDate() solves 
      this problem.  You may use either switch at will. 
 
 Other switches provided by dsDate() and not native to REXX/2 are: 
   1. dsDate()'s 'T' switch will return a full text string representation 
      of the supplied date; eg. "January 15, 1979". 
   2. DATE() has no native support to validate a date.  dsDate() provides 
      the 'V' option to validate a date.  This is very useful with data 
      entry applications to ensure data integrity of dates entered by 
      application users. 
   3. DATE() has no abilities to increment or compare dates.  dsDate() 
      provides the 'I' (increment) option to add/subtract to/from a 
      desired date.  eg. Obtain the date of the day 15 days ago or project 
      a date 15 days in the future. 
   4. dsDate() provides the 'P'(Passed) switch to calculate the number of 
      days between any two provided dates.  eg. Return the # of days 
      passed between DateParam1 and Dateparam2. 
   5. dsDate() provides the 'Q' (Quarter) switch to calculate the quarter 
      of the calendar year for the given date.  Returns integer (1-4). 
   6. dsDate() can return a Gregorian date in US format from a Julian date 
      using the 'G' (Gregorian) switch.  This is the counterpart to the 
      'J' switch of both DATE() and dsDate(). 
   7. dsDate() can return an integer representing the week day of any 
      given date using its 'Y' (daY) switch.  Unlike the 'W' switch    which 
      returns a text label, the 'Y' switch will produce a numeric suitable 
      for calculations. 
 "   

Inf-HTML End Run - Successful