BookmarkSubscribeRSS Feed
Bal23
Lapis Lazuli | Level 10

 %let _EFIERR_ = 0; /* set the ERROR detection macro variable */

 

would anybody explain why do we need this? If we do not have this, what will happen? Thanks

4 REPLIES 4
Kurt_Bremser
Super User

To answer this question, we need to know the context. (Re)Setting such automatic macro variables can and does make sense in certain situations.

 

So where have you encountered this statement?

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Think of it this way.  

 

Datastep 1 runs and fails, error code set to 1.

Datastep 2 runs and passes, but error code still 1.

 

Hence why you reset the error macro at the point you want.

Tom
Super User Tom
Super User

Normally you see that line in code generated by PROC IMPORT.  When reading from a text file PROC IMPORT is essentially an SCL program that analyzes the text file and generates a data step to read it. The generated data step will update that macro variable if there are any errors. So then the PROC can detect the updated macro variable and report the error.

art297
Opal | Level 21

If you're asking the question "Does one need to include a line of code like that when we manually rerun code that was produced by proc import or export?" the answer is absolutely not.

 

Art, CEO, AnalystFinder.com

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 4545 views
  • 2 likes
  • 5 in conversation