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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.