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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.