From: cael on 22 Jul 2010 08:21 Hi, I'm trying to let final user enter the directory location at the beginning of the code instead of re-writing it all over the place. I have another text file that reads into the code as well which might be causing the problem. I've pasted a snippet below. Any insight is appreciated. %let folderlocation = \\abcd\My Documents\; /* this is where the user enters the folder location*/ libname lib_x '"&folderlocation"'; libname output_x "&folderlocation\output_x"; %include "&folderlocation\data\macro01.sas" ; %include "&folderlocation\data\macro02.sas" ; %let variablelist= &folderlocation\input\variablelist.txt; infile "&folderlocation\input\variables.txt";
From: Ya on 22 Jul 2010 11:03 On Jul 22, 5:21 am, cael <lunacae...(a)gmail.com> wrote: > Hi, > > I'm trying to let final user enter the directory location at the > beginning of the code instead of re-writing it all over the place. I > have another text file that reads into the code as well which might be > causing the problem. I've pasted a snippet below. Any insight is > appreciated. > > %let folderlocation = \\abcd\My Documents\; /* this is where the user > enters the folder location*/ > > libname lib_x '"&folderlocation"'; > libname output_x "&folderlocation\output_x"; > > %include "&folderlocation\data\macro01.sas" ; > %include "&folderlocation\data\macro02.sas" ; > %let variablelist= &folderlocation\input\variablelist.txt; > infile "&folderlocation\input\variables.txt"; So what's the question?
From: Tom Abernathy on 22 Jul 2010 22:24 You can make your code easier by pointing a FILEREF at the folder that is storing text files like raw data or programs. For example: * Set folder location here ; %let folderlocation = \\abcd\My Documents\; * Set input variable list here ; %let variablelist=My Vars.txt; * Define input and output librefs and filerefs ; libname output "&folderlocation\output_x"; libname input "&folderlocation\input" access=readonly; filename sascode "&folderlocation\data"; filename input "&folderlocation\input"; %inc sascode(macro01); %inc sascode("macro02.sas"); data .... ; infile input("&variablelist") ...... ; .... run;
From: Patrick on 23 Jul 2010 04:56 %let folderlocation = \\abcd\My Documents\; -> ends with a backslash; libname output_x "&folderlocation\output_x"; .> adds another backslash The resolved path in the libname statement will be: \\abcd\My Documents \\output_x -> the doubled backslash after "My Documents" will cause issues HTH Patrick
|
Pages: 1 Prev: Resolve only some & in strings Next: Who is Moderating this group? |