SAS functions - SAS

Describe any three SAS functions

- LENGTH: The length of an argument is returned without counting the trailing blanks.
Ex:
animal=’my cat’;
len=LENGTH(animal);
Result is - 6


- SUBSTR: The SUBSTR function extracts a substring from a given argument starting at a given ‘position’ for ‘n’ characters or until the end if ‘n’ is not specified
Ex:
data dsn;
value =’(916)734-6241’;
substring=SUBSTR(value,2,3);
Result is - 916

- TRIM: It removes the trailing blanks from a given character expression
Ex:
Str1 = ‘my’;
Str2 = ‘cat’;
Result = TRIM(Str1)(Str2);
Result = ‘mycat’
SELECT construct is used instead of IF statements - SAS
When there is a long series of mutually existing conditions......
How to code a merge? - SAS
Step 1: Define three datasets in DATA step, Assign values of IN statement to different variables for two datasets.......
What is Program Data Vector (PDV)? What are its functions? - SAS
What is Program Data Vector (PDV)? - PDV is a logical area in the memory, SAS creates a dataset one observation at a time.......
Post your comment