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,360

Re: SAS Proc Import: How to use where clause

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
  • 376 views
  • 0 likes
  • 2 in conversation