I have similar files in a specific folder. I need to run same program for every files. So I thought of using macro. But I encountered a problem.
%macro xyz(cityname); *IMPORTING FILE;
proc import datafile='G:\Interns\Shiyas\'&cityname'.csv'
out=out.datafile
dbms=csv replace ;
guessingrows=200;
/* PROGRAM */
PROC EXPORT DATA =out.hsi_area OUTFILE = 'G:\Interns\Shiyas\SAS\Output csv files\'&cityname'\Area.csv';
PROC EXPORT DATA =out.hsi_age OUTFILE = 'G:\Interns\Shiyas\SAS\Output csv files\'&cityname'\Age.csv';
%mend;
%xyz(bangalore);
%xyz(chennai);
%xyz(delhi);
%xyz(kochi);
I know this is not the right format to call macro into a filename. But it would really helpful if I could call the argument to the filename. How can we do it?