Not sure why you still can't use DCREATE() or LIBNAME. This is the idea below.
data _null_;
path_to_folder = '/folders/myfolders/';
date_char = put(today, yymmdd10.);
folder_name = catx("_", 'folder', date_char);
y = dcreate(folder_name, path_to_folder);
run;
To check for the existence of the other folder you can use FEXIST and then FDELETE. You didn't specify how the naming is managed but it should be relatively straightforward if you have a structured process.
@Pavan4 wrote:
Hi Thanks for your reply but we are using unix environment .All the folders are in unix boxes.that is why I am using X commands
but I would need create directory with current dateformat for example the if I execute the sas code today it should create folder like 24042018 in some directory
Really appreciate your help
If you have to use X commands, you need to find the Unix commands which is best done on a unix forum, and then you pass them to the system using %SYSEXEC, CALL SYSTEM, or X statements.
In that case, I'd test the commands on the unix side first as well and then move the commands back to SAS after they're fully tested, otherwise you have more room for error.
... View more