home *** CD-ROM | disk | FTP | other *** search
- DATES
- Edit Dates/Times into a Command Line & Execute It.
- Release 2a - March 1992
- Copyright (C) 1990-1992 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, available 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
-
- Table of Contents
-
-
- INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
-
- LICENSE INFORMATION . . . . . . . . . . . . . . . . . . . . . . . 1
-
- TABLE OF CONTENTS . . . . . . . . . . . . . . . . . . . . . . . . 1
-
- PACKAGING . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
-
- USAGE: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
- Explanation of {options}. . . . . . . . . . . . . . . . . . . 2
- Edit strings in COMMAND {parameters} . . . . . . . . . . . . . 4
- Date replacements . . . . . . . . . . . . . . . . . . . . . 4
- Time replacements . . . . . . . . . . . . . . . . . . . . . 4
- Miscellaneous replacements . . . . . . . . . . . . . . . . . 4
-
- ENVIRONMENT VARIABLES . . . . . . . . . . . . . . . . . . . . . . 5
-
- EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
-
- COMPATIBILITY WITH DAYNBR. . . . . . . . . . . . . . . . . . . . . 6
- Incompatibilities . . . . . . . . . . . . . . . . . . . . . . . 7
- Enhanced Incompatibilities . . . . . . . . . . . . . . . . . . 7
-
- OTHER PROGRAM OFFERINGS . . . . . . . . . . . . . . . . . . . . . 7
-
- HISTORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
- 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 be 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.
-
- /F<file> Set the reference date to the <file>s date.
-
- This allows the reference date to be modified to a
- particular files date/time.
-
- /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.
-
- /Jc Override DATES edit character to <c>.
-
- This lets DATES use any character as the edit
- character in place of ` code. Some command processors
- (4DOS) and/or environments (DESQVIEW) use the default
- edit character, this is one way to use DATES within
- these environments.
-
- /L<file> Send log information to <file>.
-
- This will override the environment variable, so any
- log information can be written directly to <file>.
-
- /Q Quiet mode.
-
- This suppresses the copyright information displayed
- when DATES is run, allowing a clutter free screen.
-
- /R Force reported return code to zero.
-
- Unconditionally set the returned code reported to the
- log to zero. This does not change the actual return
- code reported to the operating system.
-
- /In Ignore return code <n> as an error.
-
- When a return of <n> is returned by the sub-process,
- do NOT put an exclamation (!) in the log. If the
- return code is <n>, DATES will put a hash (#)
- instead. This is so any programs that report on the
- log and looks for an exclamation as an error, won't
- report <n> as an error.
-
- Up to ten separate /I's can be used at once.
-
- /Pp Run the sub-process at priority <p>.
-
- This is an OS/2 ONLY facility.
-
- This will run the sub-process at one of the four
- possible priority levels <p> within OS/2. The levels
- are..
- i : Idle (slowest)
- r : Regular (default)
- f : Fixed-High
- t : Time-Critical (fastest)
-
- /V Verbose log.
-
- This will log the starting date/time of a command and
- the command being executed to the log.
-
- /? Help screen.
-
-
- These options can be preceded with either a slash (/) or a dash (-).
- This means that you could have two dashes in a row, this is OK. For
- example the option /-100 could also be used as --100.
-
-
- 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 default 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 (000 - 366).
- `1#### Year, including century
- (1980 - 2038).
- `2## Year, excluding century (80 - 38).
- `3## Month (01 - 12).
- `4### First 3 characters of the month
- name (JAN .. DEC).
- `5## Day of month (01 - 31).
- `6### First 3 characters of the day name.
-
- Time replacements
-
- `A## System hour (00 - 23).
- `B## System minute (00 - 59).
- `C## System seconds (00 - 59).
- `D##### System seconds since midnight
- (00000 - 86400).
- `E######## Seconds since midnight of 1st of Jan
- of the reference year (00000000 - 31622400).
-
- Miscellaneous replacements
-
- `H# The half of the year (1 or 2).
- `Q# The quarter of the year (1 - 4).
- `T# The Third of the year (1 - 3).
- `S# The sixth of the year (1 - 6).
- `W## The week of the year (1 - 53).
-
- If you want to use the edit character ` (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 pre-pending 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).
-
- This log file can be overridden by using the /L option explained
- above.
-
- 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. The @ edit character can
- ONLY be used for getting the julian day, it is included in DATES for
- compatibility with DAYNBR.
-
-
- 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 /J~ /Lc:\dates.log RENAME USERS.TXT USERS~H#.TXT
-
- This will rename the file USERS.TXT to either USERS1.TXT or
- USERS2.TXT, depending on whether the reference date is prior to, or
- after the 1st of July. The /J~ allows the use of the ~ character in
- the edit string in place of the default character of `. The command,
- elapsed time and return code will be written to a log file
- c:\dates.log.
-
-
- DATES /Fc:\command.com ECHO COMMAND.COM's julian day is `0###
-
- This will display the julian day (of the last modification) of the
- file COMMAND.COM in the root drive of the C: drive. All the other
- reference date modifiers could also be use in conjunction with the
- /F option.
-
-
- 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
-
- This will show something like this
- A37 1B4 15C
-
-
- DATES /Q RENAME bbs.log `E########.log
-
- This will rename bbs.log to the number of seconds since the new
- year. The /Q option will suppress any output generated by DATES, but
- not the RENAME command.
-
- 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 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 \ (back-slash) 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.
-
-
- 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)
- MSG Report on statistics of a message area, IE, who
- contributes and by how much. (DOS and OS/2)
-
-
-
- History
-
- 23 May 90 - Release 1a beta
- - Released for limited testing.
-
- 03 Jun 90 - Release 1a
- - Added /C Option.
-
- 17 Dec 90 - Release 1b
- - Added /Q, /R and /I options.
- - Decreased memory usage from around 80KB to around 30KB.
- - Moved log processing (open/write/close) until after the
- sub-process has executed. This allows sub-processes that access
- the log to do so without it being open, such as a backup.
- - Compiling now with MS C V6.00, which produces smaller faster
- code.
-
- 23 Jun 91 - Release 2a
- - Added /F, /L and /J options. The /J option was added for 4DOS &
- DESQVIEW users. 4DOS & DESQVIEW uses the ` character as a
- quote, with the /J option, you can set the edit character to
- anything you like.
- - Added `H#, `Q#, `T#, `S# and `W## edit strings.
- - Added /P option to the OS/2 version.