LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2011)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 19 Dec 2011 16:23:50 -0500
Reply-To:     Rich Ulrich <rich-ulrich@live.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Rich Ulrich <rich-ulrich@live.com>
Subject:      Re: macro to replace portions of variable names in syntax file
Comments: To: mpirritano@ochca.com
In-Reply-To:  <A715D7E005BF1C4D8505CA3CABB748F206C18C16@HCAMAIL03.ochca.com>
Content-Type: multipart/alternative;

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.

-- Rich Ulrich Date: Mon, 19 Dec 2011 12:57:25 -0800 From: MPirritano@ochca.com Subject: macro to replace portions of variable names in syntax file To: SPSSX-L@LISTSERV.UGA.EDU

All,

I like being able to update the dates on my files using this simple macro:

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.

[...]


[text/html]


Back to: Top of message | Previous page | Main SPSSX-L page