0

I have been trying to get this code to work...but no luck so far:

%let drive=I:;
%let dir1=%nrbquote("AB&C\Reports & Tests\ABC\My Codes\01Jan12");
%let dir2=%nrbquote("AB&C\Reports & Tests\Test ABC\01 - Jan 2012\Test Code");

%sysExec &drive move "&dir1\Code_to_Move.sas" "&dir2" /y ;

I get the error message "system cannot find the path specified" in the command prompt. I think it is due to the spaces and the "&" in the folder names but I cannot seem to fix it.

Basically trying to copy over a file from one folder to another. Files are located on a network drive "I".

Can you please suggest the best way to do this using the directory structure I posted?

1
  • have you executed %sysexec I: move "AB&C\Reports & Tests\ABC\My Codes\01Jan12\code_to_move.sas" "AB&C\Reports & Tests\Test ABC\01 - Jan 2012\Test Code" /y successfully? Feb 3, 2012 at 16:33

2 Answers 2

1

%let dir1=%nrbquote(AB&C\Reports & Tests\ABC\My Codes\01Jan12);

not

%let dir1=%nrbquote("AB&C\Reports & Tests\ABC\My Codes\01Jan12");

0

Try adding a period after &dir1 (I know you need a period after the macro var reference since it is followed by a /, not sure if other things are wrong also)

2
  • Did not work. I tried adding the period after all macros and only drive but still the same error
    – Adam
    Feb 3, 2012 at 16:52
  • Found the problem! the position of the drive macro was wrong... should be - %sysExec move "&drive.\&dir1\Code_to_Move.sas" "&drive.\&dir2";
    – Adam
    Feb 3, 2012 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.