I have a macro that has been broken for a while and I am finally getting
around to updating.
I am using a macro from Raynald's page that get's all combinations from
a set of variables and writes to a file.
What I am trying to do is take this file and, using python to reopen the
file add some lines to the bottom of this file. The python program runs
fine on it's own but when I put it inside the macro it stops running.
My guess is that the "END PROGRAM" is terminating the macro. Any
solutions to this?
DEFINE !combine (n=!TOKENS(1) /* N = COMBINATIONS */
/items=!CMDEND). /* ITEMS = LIST OF ITEMS */
/* Find all combinations of n items out of m items*/
/* Sept 11,2001 firstname.lastname@example.org */
* Count number of variables.
!DO !cnt !IN (!items)
* Write the syntax file which will call the macro for each desired
combination of variables.
WRITE OUTFILE='c:\temp\mymacro.sps' /"GET FILE = '" !DATA !DATAFILE "'."
text_file = open("c:/temp/mymacro.sps", "a")
lines = ["GET FILE='C:\TEMP\percents.sav' /drop=TOTAL.\n"
"MATCH FILES /FILE = *\n"
"/DROP j1 to first.\n"