if i having variables named a b c d e f ,how to find total of
each variable ????give syntax...??

Answer Posted / anik chatterjee

The last answer is right but if all the values are missing
then sum function will give a note in log. Best way to add
0 with all value. Hence if all value is missing then total
would be 0 and no note will be there.

proc sql;
create table SUM as
select sum(a) as sum_a,
sum(b,0) as sum_b,
sum(c,0) as sum_c,
sum(d,0) as sum_d,
sum(e,0) as sum_e,
sum(f,0) as sum_f
from input_dataset_name;
quit;

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are you sensitive to code walk-throughs peer review or QC review?

2892


i have a dataset with 100 obs i want to generate title from 20th obs onwards with total observations. that should contain 100 obs.dont use firstobs and dnt split the data. use dataset block or proc report? how can we genarate;

2176


Have you ever used the SAS Debugger?

1465


Will it bother you if the guy at the next desk times the frequency and duration of your bathroom or coffee breaks on the grounds that ?you are getting paid twice as much as he is??

2344


Describe the function and untility of the most difficult SAS macro that you have written.

1938


what do the sas log messages "numeric values have been converted to character" mean? : Sas programming

775


what is the basic structure sas administrator? : Sas-administrator

780


What are the difference between ceil and floor functions in sas?

1055


Mention what is SAS data set?

894


explain what is data set in sas? : Sas-administrator

721


what are sas/access and sas/connect? : Sas programming

747


what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake

2112


what is slowly changing dimension? : Sas-di

854


what is intially documentation in sas?

4619


Explain why double trailing @@ is used in input statement?

799