Discover More Tips and Techniques on This Blog

BASE SAS CERTIFICATION SUMMARY FUNCTIONS

Certification Summary---Functions:
sourec:http://wiki.binghamton.edu/index.php/Certification_Summary---Functions

SAS Functions can be used to convert data and to manipulate the values of character variables. Functions are written by specifying the function name, then it's arguments in parentheses. Arguments can include variables, constants, or expressions. Although arguments are typically separated by commas, they can also be specified as variable lists or arrays.

Contents[hide]

1 YEAR, QTR, MONTH and DAY Functions

2 WEEKDAY Function

3 MDY Function

4 DATE and TODAY Function

5 SUBSTR Function

6 INDEX Function

7 UPCASE Function

8 LOWCASE Function

9 INT Function

10 ROUND Function

11 TRIM Function

12 Some Sample Certification Examples

13 Points to remember


SAS Tip: How to round the numbers:

It's often a requirement to round the values of one variable to a precision defined in a different variable - either another data set variable, or a macro variable. The easiest way to achieve this is:


cooked = round(raw, 10**-dp);

In this example, the required number of decimal places is set in the dataset variable dp. The ** operator is used to convert from a number of decimal places to a suitable rounding unit for the round() function: for example, when dp is set to 3, 10**-dp becomes 10**-3, which is 10-3 or 0.001.

1 comment:

Disclosure:

In the spirit of transparency and innovation, I want to share that some of the content on this blog is generated with the assistance of ChatGPT, an AI language model developed by OpenAI. While I use this tool to help brainstorm ideas and draft content, every post is carefully reviewed, edited, and personalized by me to ensure it aligns with my voice, values, and the needs of my readers. My goal is to provide you with accurate, valuable, and engaging content, and I believe that using AI as a creative aid helps achieve that. If you have any questions or feedback about this approach, feel free to reach out. Your trust and satisfaction are my top priorities.