

Working with the character date value first, you will use the INPUT function to create a new numeric SAS variable. This will open the Enterprise Guide Query Builder.Ĭlick Computed Columns and then select New ► Build Expression to open the Advanced Expression Editor dialog box.Ĭonvert a Character Value to a Numeric Value

DATA SAMPLE Īfter you submit the code, the table opens automatically.ĭisplay the Process Flow window, right-click on your sample data set, and select Filter and Query. To create the sample data, you can select File ► New ► Code and submit the DATA step code shown below in the SAS Enterprise Guide code node.
#CONVERT CHARACTER TO NUMERIC SAS HOW TO#
This sample will illustrate how to convert variable types by using the Advanced Expression Builder. SAS Enterprise Guide enables you to create new variables (computed columns) by using the Advanced Expression builder within the Query Builder. SAS does not allow you to change the type of a variable that is already defined, so a new variable must be created. This conversion is done by using the PUT and INPUT functions. One very common data manipulation is converting a variable type from either character to numeric or from numeric to character. However, if you want to manipulate data, such as changing date values or parsing a character string, then you will need to employ some SAS programming knowledge in order to achieve your goals. SAS Enterprise Guide provides easy access to data sources through a graphical interface, which means that 99% of the time you can work in SAS without knowing the SAS programming language.
