There are many circumstances where one need change the paths contained in a syntax file. For instance

  • If you run the same syntax periodically (each week or month) but the new data is in a folder whose name identifies the data;
  • if you work both at home and at the office and it is not convenient to reproduce the drives and folders of the office at home
  • or you apply the same syntax to different clients file.

I handle these situations by defining a macro at the beginning of the syntax file:

define !Path1 ()'d:\project xy\my program files\'!enddefine.
define !Path2 ()'d:\project xy\my data files\'!enddefine.
GET FILE=!Path2+"data1.sav".
INCLUDE !Path1+"evaluate.sps".

*** note that evaluate.sps should refer to !path1 and !Path2 ***

*** do other calculations here ***.

SAVE OUTFILE=!Path2+"results.sav".

With the above method, changing paths is done only once per syntax file.