libname wombat "/folders/myfolders/macro";
data wombat.orderdata;
infile "/folders/myfolders/macro/customer.sas7bdat";
input customer_ID;
set wombat.customer;
run;
what is the relevent of set varible here....or how can I use set with out infile oprion
SET - tells SAS this is the input data set you'll be working with. You reference a dataset as LIBNAME.DATASET_NAME.
INFILE - tells SAS to read this file, used for text files, not SAS datasets (sas7bdat). SET and INFILE can be used together, but usually not at the beginning or while learning.
INPUT - tells SAS what to read from the file, in this case it's saying read a single variable Customer_ID.
Since you have a SAS dataset this isn't correct. Once you've assinged the library you can point to the dataset directly as someone else has pointed out.
If the LIBNAME statement successfully assigns the library then
data wombat.orderdata;
set wombat.customer;
run;
would create a copy of the customer data.
If you only want the customer id then add
keep customer_id;
Once the data is in a SAS data set (sas7bdat extension) then a library pointing to the location of the file and referencing the set as library.dataset is all that is needed. No Infile, no input needed
Thank you
SET - tells SAS this is the input data set you'll be working with. You reference a dataset as LIBNAME.DATASET_NAME.
INFILE - tells SAS to read this file, used for text files, not SAS datasets (sas7bdat). SET and INFILE can be used together, but usually not at the beginning or while learning.
INPUT - tells SAS what to read from the file, in this case it's saying read a single variable Customer_ID.
Since you have a SAS dataset this isn't correct. Once you've assinged the library you can point to the dataset directly as someone else has pointed out.
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.