/*----------------------------------------------------------------------------------- Macro XVARS Author : Carina Ortseifen (carina.ortseifen@urz.uni-heidelberg.de) Subject : Generation of list of k variables Xi without variable i Examples Results %xvars(5,3,x,) x1 x2 x4 x5 %xvars(5,1,X,x) X2x X3x X4x X5x -------------------------------------------------------------------------------------*/ %macro xvars( /* Input parameters: */ k, /* Amount of variables to generate */ i, /* Variable leaving out */ xpref, /* Prefix of variable names */ xpost /* Post of variable names */ ); /* Result: String with variable names */ %local j xvars; %let xvars=; %do j=1 %to &k; %if &i ne &j %then %do; %let xvars=&xvars &xpref&j&xpost; %end; %end; &xvars %mend xvars;