Hello,
I want to know if I give any conditional arithmetic expression then can I view whole datasets?
Example - if I have List of employees with Department and Salary and I have to calculate incentives for specific department but I want to view whole data set and not only those specific employees.
Do not apply a where or subsetting if statement if you want the other records. You would conditionally assign values.
data want;
set have;
if department = 'SALES' then incentive = salary* 0.1;
run;
would only add an incentive for the specific department. All the other records would have missing values for incentive.
WHERE or subsetting IF removes those records. Instead of WHERE/IF consider creating a flagged variable to identify the records instead.
@rasika wrote:
Hello,
I want to know if I give any conditional arithmetic expression then can I view whole datasets?
Example - if I have List of employees with Department and Salary and I have to calculate incentives for specific department but I want to view whole data set and not only those specific employees.
Do not apply a where or subsetting if statement if you want the other records. You would conditionally assign values.
data want;
set have;
if department = 'SALES' then incentive = salary* 0.1;
run;
would only add an incentive for the specific department. All the other records would have missing values for incentive.
Thanks a ton.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.