Schwa
Schwa

Reputation: 139

How do I get SAS to ignore missing variable names?

If a SAS DATA step references a non-existant variable in a DROP, KEEP, or RENAME statement, it returns an error saying such and stops the DATA step due to this error.

How do I get SAS to keep going with the step when it references a non-existent variable? I assume there's an OPTION for this (?) but I can't figure out what it's called if this is the case.

(I'm dealing with yearly datasets for which variables occasionally get added or deleted from year to year.)

Upvotes: 2

Views: 518

Answers (1)

o.h
o.h

Reputation: 1262

Try using:

options dkricond=nowarn dkrocond=nowarn;

First one is for input datasets, second one is for output datasets.

You might want to set these back to warn or error after you are done with the specific data steps where you know this will be an issue.

SAS Manual page

Upvotes: 4

Related Questions