HI,
i have a code I should the records which has only those vendors names but I have 30 vendor names and I don't want to type all those vendor names so is there any way . keeping all those 30 vendor names in excel and can call it using macro . Any idea ?? Pls help
Can you provide more details about what you want to do? What should the code do? What output should the code have?
You can import the excel file and write it out to a sas dataset that you can call on, you can write the 30 names into a proc format. I'm sure there are other options but without more details it's hard to help.
Import the list of vendors into SAS.
Create a proper cntlin file for proc format that assigns the value 1 to all vendors, and attach a line for "other" that assigns 0,
Aplly that format in a data step and keep only the records where the formatted value is 1.
If you're not yet firm with all these procedures/steps, copy/paste the list into the EG code window and reformat it manually so that it can be used in an "in" condition.
Hi,
proc import datafile="xyz.xlsx" out=temp;
run;
proc sql;
create table WANT as
select *
from HAVE
where VENDOR in (select distinct COL1 from TEMP);
quit;
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.