Interview Questions   Tutorials   Discussions   Programs   Videos   

SAS - Name and describe three SAS functions that you have used, if any?




323
views
asked mar September 20, 2014 06:30 AM  

Name and describe three SAS functions that you have used, if any?


           

1 Answers



 
answered By vishnoiprem   0  

LENGTH: returns the length of an argument not counting the trailing blanks.(missing values have a length of 1)Ex:

a=’my cat’;
x=LENGTH(a);

Result: x=6…

SUBSTR: SUBSTR(arg,position,n) extracts a substring from an argument starting at ‘position’ for ‘n’ characters or until end if no ‘n’. Ex:

data dsn;
A=’(916)734-6241’;
X=SUBSTR(a,2,3); 
RESULT: x=’916’ ;
run;

TRIM: removes trailing blanks from character expression.

Ex: a=’my ‘; b=’cat’;X= TRIM(a)(b); RESULT: x=’mycat’.

SUM: sum of non missing values.Ex: x=Sum(3,5,1); result: x=9.0

INT: Returns the integer portion of the argument.

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert