Save file with today's date and include subcommands

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

0101
Posts: 52
Joined: Fri Mar 04, 2011 9:42 pm

Save file with today's date and include subcommands

Postby 0101 » Thu Dec 08, 2011 3:52 pm

I have syntax that saves a file and adds today's date to the filename. It works great (and is simple!). But I'd like to modify it so it supports subcommands, like /COMPRESS, /DROP, etc.

The SAVE OUTFILE line also references a macro that defines the folder path ahead of time, so I'm not sure if that complicates things.

Code: Select all

* Below is a list of common folders we use. 
* Comment out all the ones you don't want to use for this session.

define !Path1() 'E:\MyDocs\Work\'!enddefine.
* define !Path1() 'C:\Personal\'!enddefine.
* etc.

* Save file with today's date.

string #savecmd(a150).
do if $casenum EQ 1.
- compute #savecmd = concat("SAVE OUTFILE='",!Path1,"This is my file name ",$date,".sav'.").
- write outfile = "C:\temp\save.txt" / #savecmd.
end if.
exe.

* run the macro.
include file = "C:\temp\save.txt".
Any suggestions on how to include SAVE OUTFILE subcommands with this?
0101
Posts: 52
Joined: Fri Mar 04, 2011 9:42 pm

Re: Save file with today's date and include subcommands

Postby 0101 » Mon Dec 19, 2011 5:10 pm

Any ideas?

Who is online

Users browsing this forum: No registered users and 2 guests

cron