%*---Companion to liname macro. Instead of generating a libname this macro generates a direct literal reference to a SAS data set as supported starting with V7 of SAS. Output is a double-quoted string with the full path and set name. ---*; %macro setref(filetype, /* 1st parm can be just the filetype, a subdir of basedir directory, OR, it can be the filetype, a period, and the set name all in one. E.g. %setref(indctrs.mocopop) will work. */ dset, /* 2nd positional parm used to specify the SAS data set name. Can be omitted if the value of first pos. parm contains a period in which case the dset parm is the part after the period. But you can specify, for example, %set(indctrs,mocopopg) */ basedir=%str(/pub/data) /* The base directory where the filetypes reside. Fixed by platform but can be overridden to use macro in other directories. */ ); %*--this macro will generate a literal reference to a SAS data set. macro by John Blodgett, OSEDA, U of Missouri OE. Original coding 11-2001. Last mod: 11-18-01 Initial coding. --; %local path path2; %if %quote(&dset) = %then %do; %let dset=%scan(&filetype,2,'.'); %if &dset ne %then %let filetype=%scan(&filetype,1,'.'); %end; %else %do; %put *****Error**** setref macro requires 2 parameters or 1 parm with a period in it**; ????????????? %end; %let path=&basedir/&filetype; %let path2=&path/&dset; "&path2" %mend setref;