Unlock IN Operator in SAS Macro 

sas macro

Gray Frame Corner

By Subhro Kar

Introduction

IN operator is used in the data step to replace multiple OR conditions.

IN Operator is not available in Macro Language  

In macros, the IN operator fails to execute.

ERROR: Required operator not found in expression: &names  in(‘Alice’,’James’,’John’,’Judy’)  ERROR: The macro TEST will stop executing.

By Subhro Kar

Solution 

White Frame Corner

By Subhro Kar

1. MINOPERATOR 

System Options 

White Frame Corner
White Frame Corner

2. MINDELIMITER 

Enabling this option, you can use the IN (#) operator with the list of values.

It is used to specify the delimiter for the list of values used in the IN operator.

to use the IN operator inside a macro, there are 2 system options you need to specify.

By Subhro Kar

MINOPERATOR 

White Frame Corner
White Frame Corner

The list of values can be used with the IN (#) operator.

By Subhro Kar

MINDELIMITER 

White Frame Corner
White Frame Corner

It is used to specify the delimiter for the list of values used in the IN operator.

%macro macroname / mindelimiter=',';

options minoperator; options mindelimiter=',';

OR

By Subhro Kar

Learn more SAS Tips & Tricks on:

Gray Frame Corner

0218

By Subhro Kar