For the data set I am working with, I have a date column. For example, when looking at Excel for one row, the date value is "11/2/2020"
When I import into SAS and look at proc contents, it says that the entire column is a character type, $1 format. The value for the example row I gave above became 2.
There is another date column in the data set that isn't having this problem? Thanks.
@littleka wrote:
For the data set I am working with, I have a date column. For example, when looking at Excel for one row, the date value is "11/2/2020"
When I import into SAS and look at proc contents, it says that the entire column is a character type, $1 format. The value for the example row I gave above became 2.
There is another date column in the data set that isn't having this problem? Thanks.
How did you read the data into SAS. Did you use PROC IMPORT? Show the code you ran.
What type of file do you actually have? If it is an actual EXCEL file such as XLSX file or even the older XLS file then what you describe cannot happen.
If it is instead a text file, like a CSV file, then just write your own data step to read the file and you will have full control over how the variables are read.
Save the data as csv from Excel, inspect it with a text editor to see how the values are stored, and the read it with a data step according to your findings.
@littleka wrote:
For the data set I am working with, I have a date column. For example, when looking at Excel for one row, the date value is "11/2/2020"
When I import into SAS and look at proc contents, it says that the entire column is a character type, $1 format. The value for the example row I gave above became 2.
There is another date column in the data set that isn't having this problem? Thanks.
How did you read the data into SAS. Did you use PROC IMPORT? Show the code you ran.
What type of file do you actually have? If it is an actual EXCEL file such as XLSX file or even the older XLS file then what you describe cannot happen.
If it is instead a text file, like a CSV file, then just write your own data step to read the file and you will have full control over how the variables are read.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.