Help using Base SAS procedures

SAS Proc Import: How to use where clause

Reply
Frequent Learner
Posts: 1

SAS Proc Import: How to use where clause

How to import only those records where Category is Fruit and Country is United States, while importing this excel file into SAS using proc import?

PROC Star
Posts: 7,492

Re: SAS Proc Import: How to use where clause

Posted in reply to devdutt88

Here is one way:

 

libname excl xlsx '/folders/myfolders/product.xlsx';

data want;
  set excl.sheet1 (where=(Category eq 'Fruit' and Country eq 'United States'));
run;
Ask a Question
Discussion stats
  • 1 reply
  • 673 views
  • 0 likes
  • 2 in conversation