[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
RE Date variables in Xy III
- Subject: RE Date variables in Xy III
- From: Patricia M Godfrey pmgodfrey@xxxxxxxx
- Date: Wed, 22 Oct 2003 10:37:07 -0400
Thanks, eveyone. Yes, the lack of comma was a typo. I will try all your
suggestions when I have a chance (Tuesdays and Wednesdays are bedlam
here), but let me expalin what I'm trying to do:
I want an idiot-proof, preferably untouched by human hands, routine to
archive the data files at the local weekly each week. (SOP there is to
recycle file names and overwrite the previous week's files. As this is
the paper of record and an important resource for local history, I think
those files should be saved, though the hard copies do get bound at
year-end.) The archive copies go on Direct CDs (the files are small
enough for almost a month's worth to fit on a CD). Because of the reuse
of files names, lumping all the copies together would cause the earlier
ones to be overwritten. (This is similar to Marc's problem and solution.)
So each week's go into a directory named with the day of the backup:
20031001, 20031008, and so on.
I can write and alter a batch file each week, or even run the XCOPY /s /m
/v commands from a DOS prompt, but if I have to be away for a couple of
weeks, I want something that my, ah, technologically challenged
colleagues can use. DOS batch language is quite powerful, but it cannot
get a date and transform it into a directory name. So I thought to
automate the writing of the batch file with Xy. It worked fine in Xy 4,
but the only machine with Xy on it at the office is one that only I use.
Then I turned up an old floppy with Xy III on it, and thought if I put Xy
3 on a floppy (or even on the CD and made it auto run), I could use a
batch file to call Xy (which would have the XPL pgm called by its
startup.int), then call the resulting batch file. Not quite recursion,
perhaps, but a step in that direction.
Here's the Xy4 routine, which works fine:
>>>BC new temp.txt
It produces a temp.txt file that looks like this:
mkdir d:\20031022
cd d:\20031022
I would then MERGE anoother file, containing the constant batch file
xcopy commands, then store or typef temp.txt to a:\backup.bat (first
using an EXIST, IF ER routine and ERNV to delete the previous version if
there). The final command in the XPL routine would be to Quit Xy,
returning control to the original calling batch file, which would then
call a:\Backup.bat. If that were on an auto-run CD, the only human
intervention needed would be to check if the CD were getting full, and I
could do that before leaving and start an new one if necessary.
Patricia