- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content