DATA Step, Macro, Functions and more

Data step read error handling

Reply
Occasional Contributor
Posts: 6

Data step read error handling

Hello world! =)

I have faced to next problem. Can I check access permission to the data to read and handle an error (if there is an error)?

For example: I need to know does user, that run SP, have permission to read the source and handle an error if there not.

I tried something like this:

data _null_;

     set DATA(obs=0);

     if _error_ ne 0 then do;

          put NOTE: "ERROR =" _error_;

          _error_ = 0;

     end;

run;

But it does not work =(

Any ideas? Thank you.

Super User
Posts: 5,258

Re: Data step read error handling

Try to use the automatic macro variables sysrc and syscc.

Data never sleeps
Occasional Contributor
Posts: 6

Re: Data step read error handling

Thank you.

I tried to user SYSRC and SYSCC but there is no effect.

Or may be I use them incorrect. If you have an example, it would be a pleasant if you share it =)

Ask a Question
Discussion stats
  • 2 replies
  • 240 views
  • 0 likes
  • 2 in conversation