Date: Mon, 19 Dec 2011 16:23:50 -0500
Reply-To: Rich Ulrich <email@example.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Rich Ulrich <firstname.lastname@example.org>
Subject: Re: macro to replace portions of variable names in syntax file
The simplest and most transparent way may be the old-fashioned one -
Create a basic syntax file with a dummy date, e.g., XXX_XXX.
Then, for the monthly processing, create the Report file, which will -
1) read your basic syntax file as a single Text variable per line;
2) use sub-string replacement in order to replace XXX_XXX with
your desired date, e.g., Sep_Oct;
3) "write" out the file as Text and close it;
4) "Include" the new text file to run it.
Each month, you change the desired date, and then run the Report.
Date: Mon, 19 Dec 2011 12:57:25 -0800
Subject: macro to replace portions of variable names in syntax file
I like being able to update the dates on my files using this
DEFINE !filedate() '20111219' !ENDDEFINE.
But now I have variable names that have a date embedded in
them. I want to update all instances of those variable names with something
like a macro.
For example, a typical command might be:
if (Sep_Oct_2011_credits = 1)
priordebitmatched_Sep_Oct_2011_credits_credits = 1.
I want to change the month and date portions since they will
change every time I run the file, and I donít want to have to convert all
the syntax to a macro. That seems overkill.