Hi all,
I m using SAS EG, realized the data source i had imported was with incorrect "Informat".
Would like to change data source from "Character" to "Numeric". (not alter in Query Builder)
Anyone could help me out?
Thanks!
How could i do this in Query Builder?
As when i wanna changed from "Character" to "Comma20.5", it appeared as below"
Please assist.
Well, first of course click on Query Builder.
When the first screen of Query Builder opens, click on "Add a New Computed Column." I'm using EG 8.2, but other versions will have something similar.
Notice in the above that I have a variable called Num_Char which contains numbers but has been defined as character.
When you click on "Add a New Computed Column," click on "Advanced expression" and click on "Next".
In the next screen, type in INPUT(your_variable_name, 8.) in the expression window. My variable name is Num_Char, but you should substitute your variable name. Click on "Next."
In the next window, type in the name of the column, the length (generally 8 for numeric variables), and the desired format (in this case COMMA20.5).
Click on "Next," and in the following window, click on "Finish." When you click on "Finish," the Query Builder dialog windows will close, and you'll be back to the main Query Builder window. Click on "Run."
The Query will run, and you will have a new column named with whatever name you gave it (I typically would use the original character name but the definition will now be numeric).
Jim
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.