Question-: What is the difference between function and procedure?
Answer: In SAS the fundamental difference between function and proc is that function expects the argument values across an observation in a SAS DATA set and procedure expects one variable value per observation. data he_learner ; set he_fee ; avgfee = mean( of F1 - F6 ) ; run ;
proc sort ; by month ; run ; proc means ; by month ; var avgfee ; run ;
In the above code you can see calculate the average fee for each observation in a day for 6 courses. And the proc means we are passing the same average fee for each day and it calculates the mean value across 30/31 observation in the month.
Question-: What is the difference between sum function and + operator?
Answer: In case of SUM function it would do the summation for all non-missing values while with the “+� operator, if there is any missing value then it would generate missing value as a final output.
Question-: What is the difference between PROC MEANS and PROC SUMMARY?
Answer: Both PROC SUMMARY and PROC MEANS produces the exactly same output dataset the difference between these two procedures is that PROC MEANS produces a report by default while PROC SUMMARY produces an output dataset by default. Hence, if you want to report printed to the listing use the PROC MEANS and if you want that info to be passed to a dataset for further then use proc summary.
Question-: When SAS can not convert numerical value from character value automatically?
Answer: When it has a non-numeric value like $ sign, for that you have to use informat.