Hi Guys,
GoodMorning
when we use infile statement to create dataset from extranal data
IF statement works
data dsn;
infile "/home/u35263349/sampleinfile.txt" dsd;
Input id name$ sex$ age sal;
where sex='f';
run;
data dsn1;
set dsn;
where sex='f';
run;
Maxim 1!
From the documentation of the WHERE Statement:
Selects observations from SAS data sets that meet a particular condition.
Emphasis by me.
You do not read from a dataset (no SET, MERGE, MODIFY or UPDATE statement).
When you want to filter during reading from an external file, you must use a subsetting IF.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.