
          DATES - Release 1a                                          Page  1



                                      DATES
               Edit Dates/Times into a Command Line & Execute It.
                           Release 1a - 3rd June 1990
                       Copyright (C) 1990 by Graham Stair



          Introduction

          DATES is an enhanced replacement to Ben Bakers DAYNBR. It came about
          because I needed to put more than just the Julian day in my  command
          line, and I needed  it in the  OS/2 environment as  well as the  DOS
          environment.

          DATES enhancements over DAYNBR are...

               It passes the return code back from the command line.
               It has extra date and time edit strings.
               Distributed with versions to run under OS/2 or DOS.
               Uses the COMSPEC environment variable.
               Logs elapsed time, return code and command line.



          License Information

          DATES  is  a  FREELY  AVAILABLE  package,  along  similar  lines  as
          Binkleyterm and it's source.  If you would like  the source code  to
          DATES, please  contact me.  The source  is free  and ONLY  available
          DIRECT from me at your cost.

          DATES and it's source code are  NOT public domain, you can NOT  make
          changed copies available for anybody else without my permission. Any
          source changes should be re-directed back to me for possible use  in
          future versions of DATES.

          Please contact me data at ...

          3:711/409.0    +61-2-498-9184

          or snail mail at ...

          Graham Stair
          P.O.Box 99
          Pymble NSW 2073
          Australia

          DATES - Release 1a                                          Page  2



          Table of Contents

          INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

          LICENSE INFORMATION  . . . . . . . . . . . . . . . . . . . . . . . 1

          TABLE OF CONTENTS  . . . . . . . . . . . . . . . . . . . . . . . . 2

          PACKAGING  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

          USAGE: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
             Explanation of {options}  . . . . . . . . . . . . . . . . . . . 3
                /+nnn     Add <nnn> days to the reference date.  . . . . . . 3
                /-nnn     Subtract <nnn> days from the reference date. . . . 3
                /Dn       Select a specific day <n>. . . . . . . . . . . . . 3
                /C        Force use of COMSPEC environment variable. . . . . 4
                /?        Help screen. . . . . . . . . . . . . . . . . . . . 4
             Edit strings in COMMAND {parameters}  . . . . . . . . . . . . . 4
                Date replacements  . . . . . . . . . . . . . . . . . . . . . 4
                   `0### or @###  Julian day of the year.  . . . . . . . . . 4
                   `1####         Year, including century. . . . . . . . . . 4
                   `2##           Year, excluding century.   . . . . . . . . 4
                   `3##           Month. . . . . . . . . . . . . . . . . . . 4
                   `4###          First 3 characters of the month name.  . . 4
                   `5##           Day of month.  . . . . . . . . . . . . . . 4
                   `6###          First 3 characters of the day name.  . . . 4
                Time replacements  . . . . . . . . . . . . . . . . . . . . . 5
                   `A##           System hour. . . . . . . . . . . . . . . . 5
                   `B##           System minute. . . . . . . . . . . . . . . 5
                   `C##           System seconds.  . . . . . . . . . . . . . 5
                   `D#####        System seconds since midnight. . . . . . . 5
                   `E########     Seconds since midnight of 1st of Jan . . . 5

          ENVIRONMENT VARIABLES  . . . . . . . . . . . . . . . . . . . . . . 5
             COMSPEC        This points to your command processor,   . . . . 5
             DATES.LOG      {drive}{path}filename{.ext}  . . . . . . . . . . 5
             OPUS.LOG       {drive}{path}filename{.ext}  . . . . . . . . . . 5
             BBS.LOG        {drive}{path}filename{.ext}  . . . . . . . . . . 5

          EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

          COMPATIBILITY WITH DAYNBR. . . . . . . . . . . . . . . . . . . . . 7
             Incompatibilities . . . . . . . . . . . . . . . . . . . . . . . 7
             Enhanced Incompatibilities  . . . . . . . . . . . . . . . . . . 7

          OTHER PROGRAM OFFERINGS  . . . . . . . . . . . . . . . . . . . . . 8

          HISTORY  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

          DATES - Release 1a                                          Page  3



          Packaging

          The following files should be in your DATESxx archive.

          DATES-R.EXE    DOS Real mode version of DATES.
          DATES-P.EXE    OS/2 Protected mode version of DATES.
          DATES.DOC      This documentation.



          Usage:

               DATES {options} COMMAND {parameters}


          Explanation of {options}

               /+nnn     Add <nnn> days to the reference date.

               /-nnn     Subtract <nnn> days from the reference date.

               <nnn> may any decimal number  from 0 to 32 thousand  something.
               Although in practice the dates are limited to the range 1st Jan
               1980 to 18th Jan 2038.

               /Dn       Select a specific day <n>.

                         <n> is a single digit which selects a specific day on
                         or prior to  the reference  date. The  digits are  as
                         follows...
                              0 .. Sunday
                              1 .. Monday
                              2 .. Tuesday
                              3 .. Wednesday
                              4 .. Thursday
                              5 .. Friday
                              6 .. Saturday

               The reference  date starts  out as  the system  date.  Multiple
               {options} can  appear and  are processed  left to  right,  each
               modifying the previous reference date in it's own way.

          DATES - Release 1a                                          Page  4



               /C        Force use of COMSPEC environment variable.

                         This option  forces DATES  to invoke  the COMMAND  by
                         directly  calling  the   operating  systems   command
                         processor (pointed  to  by  the  COMSPEC  environment
                         variable).

                         If this  option  isn't  used, DATES  first  tries  to
                         execute COMMAND by by-passing the command  processor.
                         If the COMMAND isn't executed correctly, it then uses
                         the command processor.

                         You would use  this option in  the cases where  DATES
                         does not execute the command correctly without  going
                         through the  command  processor.  Note,  this  option
                         takes additional memory as  the command processor  is
                         being loaded no matter what.

               /?        Help screen.



          Edit strings in COMMAND {parameters}

          COMMAND {parameters} is  any string with  DATES edit strings,  which
          after replacement is converted to a valid operating system command.

          The COMMAND and {parameters} can contain the following edit strings.
          These  edit  strings  will  be  replaced  with  the  date  and  time
          information of the reference  date as indicated  here, then the  new
          COMMAND {parameters}  will be  passed to  the operating  system  for
          execution.

          The edit code, ` (ascii 096), and it's one character identifier  (of
          which the case  is irrelevant),  are not  moved to  the new  COMMAND
          line. Each of the hashes (#)  are converted and take up exactly  one
          spot in the final COMMAND line. They are zero filled on the left  if
          need be. The at symbol (@), can be  used in place of the `0 for  the
          Julian date only.


          Date replacements

               `0### or @###  Julian day of the year.
               `1####         Year, including century.
               `2##           Year, excluding century.
               `3##           Month.
               `4###          First 3 characters of the month name.
               `5##           Day of month.
               `6###          First 3 characters of the day name.

          DATES - Release 1a                                          Page  5



          Time replacements

               `A##           System hour.
               `B##           System minute.
               `C##           System seconds.
               `D#####        System seconds since midnight.
               `E########     Seconds since midnight of 1st of Jan
                              of the reference year.

          If you want  to use  a `  (ascii 096, 0x60)  or @  without it  being
          interpreted as an edit string, put two of them together (I.E. ``  or
          @@). Any non #'s in any of  the edit strings, in any position,  will
          NOT be replaced.

          The /+nnn, /-nnn and /Dn options will not affect the `A, `B, `C, and
          `D edit strings,  as these are  relative to midnight  of the  system
          date and thus don't change when a day changes.

          First DATES tries to execute  your modified COMMAND by using  normal
          operating system procedures to find the command. I.E. looking in the
          current directory  and then  checking  down the  paths in  the  PATH
          environment variable. If the  COMMAND is not  found, DATES tries  to
          execute it once again by prepending the COMSPEC environment variable
          to the command and running that.  If the command is still not  found
          or the COMSPEC variable isn't declared then an error is produced.



          Environment Variables

          DATES uses up to two environment variables. They are..

          COMSPEC        This points to your command processor,
                         and is required to be set.

          Only the FIRST of the following environment variables will be  used.
          Each points to a log filename. If one of these is defined, one  line
          containing the elapsed time (et), return code (rc) and command  line
          (cl) executed is logged to the file. If none are define, no  logging
          is done.

          DATES.LOG      {drive}{path}filename{.ext}
          OPUS.LOG       {drive}{path}filename{.ext}
          BBS.LOG        {drive}{path}filename{.ext}

          The {drive},  {path}  and {.ext}  are  optional. If  you  leave  out
          {drive} and  {path},  remember, your  COMMAND  line may  change  the
          current drive and/or directory, thus leaving filename's created  all
          over your disk(s).

          DATES - Release 1a                                          Page  6



          Examples

               DATES ECHO `0###     ..or..     DATES ECHO @###

          This will echo the current Julian day of the year to the screen.  If
          you want the look at the  most recent Sundays Julian day number  you
          would add a /D0 between DATES and ECHO.


               DATES /+1000 /D4 ECHO `6### `1####/`3##/`5## `a##:`b##:`c##

          The above command will first get  the system date, add 1000 days  to
          it (/+1000), then find the most recent Thursday (/D4). Then it  will
          produce something like this 'Thu 1993/02/11 17:50:23'


               DATES /+10 /D5 /-10 ECHO `2##/`0###

          This will add  10 days (/+10)  onto the system  date, find the  most
          recent Friday  then take  10  days off  (/-10)  this date.  This  is
          different to /+10 /-10 /D5, try it!


               DATES DAY`6###

          This command  will  execute  files called  DAYSUN,  DAYMON,  DAYTUE,
          DAYWED, DAYTHU, DAYFRI, DAYSAT on their respective days.


               DATES /-7 DATES DATES /+7 ECHO `0A## ``0#B# ````0##C

          will show something like this
               A37 1B4 15C


               DATES RENAME bbs.log `E########.log

          will rename bbs.log to the number of seconds since the new year.

          DATES - Release 1a                                          Page  7



          Compatibility with DAYNBR.

          First, a big thanks to Ben  Baker for producing DAYNBR V1.0 back  in
          1985.  I  just  out  grew  it...  with  DATES  the  results.   These
          incompatibilities are due to MS C 5.1 limitations. If you  currently
          don't use any of the problems and features below, you can copy DATES
          to DAYNBR and start using it straight away.


          Incompatibilities

          DAYNBR can handle dates +/-  32 thousand something from the  current
          date. DATES works in the range 1 Jan 1980 - 18 Jan 2038.

          DAYNBR can have  straight double  quotes (")  in it's  <parameters>.
          DATES needs a  \ (backslash) if  you want the  literal double  quote
          (").  I.E.

               DATES /D5 FIND \";A\" NODELIST.`0###

          will find all occurrences of ;A in the current nodelist.


          Enhanced Incompatibilities

          The following "incompatibilities"  are due to  my enhancements  over
          DAYNBR.

          DATES uses the ` (ascii 096) character as an edit string enabler. If
          you want to use this character normally, double it up.

          DATES returns the return code (for testing with the ERRORLEVEL batch
          facility) of the COMMAND it executed.

          Your COMSPEC environment  variable is  REQUIRED to  be defined  (and
          pointing  to  your  command  processor)  under  DATES.  DAYNBR   has
          COMMAND.COM hard coded into it's code, thus requiring COMMAND.COM to
          be in the path.

          Some programs that run under DAYNBR, won't run under DATES. This  is
          usually because the  programs don't  like being  called directly  by
          DATES. Try using the /C option  to go through the command  processor
          in these cases.  I have found  only one program  that requires  this
          option so far, that is, IBM's PS2TAPE V1.11 program for DOS.

          DATES - Release 1a                                          Page  8



          Other Program Offerings

          The following  program offerings  are  other software  developed  by
          myself. If you would like any of them please contact me.

          GOOSE     On-line password checker/changer/enforcer  for OPUS  1.0x,
                    OPUS 1.1x and MAXIMUS 1.0x. (DOS)
          LOGS      Split and/or  Merge OPUS/BINK  style log  files. (DOS  and
                    OS/2)
          RECURR    Schedule recurring events. (DOS)
          LOGMSG    Log messages (incl disk space) to an OPUS/BINK style  log.
                    (DOS and OS/2)
          MR/PM     Message  Reader  for  OS/2   PM  for  OPUS  1.1x.   (Under
                    development)


          History

          23 May 90 - Release 1a beta
               Released for limited testing.

          03 Jun 90 - Release 1a
               Added /C Option.











































