|
If you are trying to read file names and dates from data, then you will need a
prior datastep that assigns data values to macrovariable names. You can then
construct the filename, assign it to variable in a subsequent datastep, and use
the FILEVAR= option of the FILE statement to associate a valid SAS name with an
external file. Sig
/*Construct filename filejan1998.01.31 and create file.*/
data stuff;
somefile="file";
date=mdy(1,31,1998);
call symput('somefile',somefile);
call symput('dat',date);
run;
%put &dat &somefile;
data null;
set stuff;
name= "&somefile"||lowcase(put(&dat,monyy7.))||'.'||
put(month(date),z2.)||'.'||put(day(date),z2.);
put name=;
file fi filevar=name;
/* put this 1-7 that 9-10; */
run;
____________________________ Original Question ____________________________
I can't seem to get SAS to create an external data file when using a macro
variable. Is it possible to do this another way:
data null;
set stuff;
file 'some_file'&date
put this 1-7 that 9-10;
run;
Maybe the output file name would be: filejan1998.01.31
|