I am looking for salary total. What can I do for that? Please rectify my query.
proc import datafile="C:\Users\user\Desktop\result of sas\Assignments\EMPLOYEE.csv" out=work.employee dbms=csv replace;
run;
data emp;
FORMAT salary dollar8.;
set work.employee;
run;
There are multiple ways of acquiring the sum of a column in SAS.
Here are a couple of ways that could work for you.
data Sums;
Set Employee end = last;
Retain Total;
Total + Salary;
keep Total;
if last;
Run;
Proc SQL;
Select Sum(salary) As Total_Sum
From employee;
Quit;
please use proc contents to see whether your column is numeric value or not and also see whether you are using column label instead of column name(I think this is what might be happening).
@kiranv_ wrote:
please use proc contents to see whether your column is numeric value or not and also see whether you are using column label instead of column name(I think this is what might be happening).
@kiranv_ I think Salary is a character column. You can see that becauses it's aligned right. Numeric columns are aligned left and characters are aligned right, by default.
Yes, You are right @Reeza
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.