Date: Mon, 19 Mar 2012 08:42:08 -0400
Reply-To: PhilRack@minequest.com
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Phil Rack <philrack@MINEQUEST.COM>
Organization: MineQuest, LLC
Subject: Re: Creating a folder in SAS program
In-Reply-To: <201203191225.q2J4aOkc019367@wasabi.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
%macro createfolder(folder=);
%let newfolder = %sysfunc(dequote(&folder));
data _null_;
call system("md &newfolder");
run;
%mend;
%createfolder(folder='c:\abcxyz\');
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of anon
Sent: Monday, March 19, 2012 8:26 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Creating a folder in SAS program
Dear all,
I have found codes from previous SAS lists which creates a folder in SAS.
However, they do not work when I use a macro.
My aim is, that I would like to create a folder for each month that I run
this programme and for the output to go directly into the folder for that
month.
The codes that I have found and tried are below, however when I introduce a
macro (which gives the month and year programme was run) then the folder
created is &date1 and not monthyear as it does in the program itself.
CODES - date1 is the macro for the day and month.
x 'md "C:\.....................\&Foldername" '; %let FOLDERNAME=&date1;
x 'md "C:\.......................\&date1." ';
Does anyone have any suggestions?
Thank you in advance.
BW