40 Most Common SAS Statements, Functions and Procedures

I. SAS Steps

1. DATA Step

Function: to create SAS data sets

2. PROC Step

Function: to perform data manipulation, statistical analysis and report / graph production


II. SAS Statements

3. Libname Statement

Function: to create a SAS library

4. Input and Datalines statement

Function: create a SAS data set with specified contents

5. Filename statement

Function: to specify the external data file

6. Infile statement

Function: to read in an external data file

7. Set statement

Function: to copy the contents from one data set into another

8. If-then statement

Function: set conditional statement to execute different functions

9. Keep, drop statement

Function: to keep only the variables needed in the data set

10. Merge statement

Function: to merge multiple data set into one


III. SAS Statements

11. Sum function

Function: to add up values

12. Basic mathematical operation

Function: to perform basic mathematical operations

13. Random Variable (Exponential)

Function: to create a random value from an exponential distribution

14. Random Variable (Uniform)

Function: to create a random value from a uniform distribution

15. Square / Square Root

Function: to calculate square and square root of a numeric value

16. Combine character variable

Function (double stroke): to combine two character values

17. Substr

Function: to extract partial text from a character value

18. Trim / Compress

Function: to remove trailing space (TRIM) or to remove all spaces (COMPRESS) from a character value 

19. Index

Function: to identify the position where the specified text is found from a character value

20. Upcase, lowcase, propcase

Function: to convert the character value into upper case (UPCASE), lower case (LOWCASE) or proper case (PROPCASE)

Note: Proper case = Upper case in the first letter of each word and lower case in the rest

21. Label

Function: to change the label of the variable

22. Length

Function: to change the length of the variable

23. Format

Function: to change the format of the variable

24. ABS

Function: to convert the numeric value into an absolute value

25. INPUT

Function: to convert a character value into a numeric value

26. PUT

Function: to convert a anumeric value into a character value

27. Log

Function: to convert the numeric value into logarithm

28. Mean, Min, Max

Function: to compute the mean, minimum and maximum of a set of numeric values

29. Rename

Function: to rename a variable

30. Round / Floor

Function: to round a numeric value


IV. SAS Procedures (PROC Step)

31. Proc Sort

Function: to sort a data set

32. Proc Transpose

Function: to convert rows into columns in a data set

33. Proc Freq

Function: to compute frequency count and percentage of a variable

34. Proc Means

Function: to compute summary statistics such as mean, standard deviation and median

35. Proc GChart

Function: to create pie chart or histogram

36. Proc Reg

Function: to perform regression analysis

37. Proc GLM

Function: to perform general linear modeling

38. Proc Gplot

Function: to plot graphs

39. Proc Print

Function: to print the content of the data set

40. Proc Report

Function: to create a report from the data set

4.1 9 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments