Hi All,
I want some alternative for _Error_ in proc copy. I want to copy all dataset from one library to another library and while doing so,if any error occurred I want to use the do and if condition to control the code.
For example-:
Proc copy in=libname1 out=libname2;
if_error_=1 then do;
%message(call a macro);
%put(" THere is a error while copying");
end;
run;
I know _error_ will work with dataset. But not sure either it will work with procedure or not.If anyone can suggest me the alternative for the same it will be a great help.
Thanks
Ankit
Lots of errors and misunderstandings here:
First, the macro PREprocessor is exactly that: the macro is resolved while the code is being read for execution, not when the procdure runs.
Second, data step code won't work in procedures. Only some statements (eg "by") are quasi-global.
Check the automatic macro variable &syscc before and after the proc copy step. Make sure that your code before that step is clean and leaves syscc at its initial value 0.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.