Hello; This is one of way %macro VarName(stuffin,indx); proc datasets library=work nolist; modify YOUR_DATASETNAME; rename var&indx="&stuffin"; ( which is Oldname = Newname) format var&indx $8.; run; %mend VarName; /* call the macro that will create the labels */ %macro loopin(); %local i; attrib thename length=$8; %do i=3 %to &num_month; (loop to maximum number of the column you have) thename=put(DateVariable,yymmd.); /* help on format SAS(R) 9.3 Formats and Informats: Reference*/ call execute('%VarName('|| thename||"," ||&i||')'); %end; %mend loopin; We have used this for the labeling the column for the different year and month. I have modified little bit for you for the rename. If you have any problem let me.
... View more