This is particularly useful when you have numerically coded categorical variables for example, a variable representing a multiple-choice question.įor more on defining your own formats, check out the User-Defined Formats tutorial. In addition to the built-in formats, it's possible to define your own formats in SAS.
Change character to numeric in r full#
you can add, subtract, multiply, and divide them), but arbitrarily change the formatted display of those numbers without sacrificing the "numeric-ness" of the variable.įor a full list of built-in formats, see the SAS documentation: This may seem like a small matter, but it's incredibly powerful: it allows you to have variables in your dataset that function as numbers (i.e. Writing numbers as roman numerals ( ROMANw.
To understand the need for informats and formats, let's start with a simple example. In this tutorial, we'll focus on SAS's built-in formats, which mostly cover numeric, date, and character variables. In SAS, formats and informats are pre-defined patterns for interpreting or displaying data values.