my data resides in an Oracle DB. I extract data from the DB in csv format. For the date field I use
to_char(BIRTH_DT,'DD-MON-YYYY') to get the date. I then import the csv file into SAS using Proc Import.
I extract two sets of data from the ORACLE DB - both different due to other constraints. The BIRTH_DT field is common in both the sets.
When I import one set of data, SAS reads it is a DATE. For the other other set it reads it as DATETIME. I do not understand why the same column is being interpreted by SAS in different ways.
Any help will be deeply appreciated.
If you haven't used it, you might want to look at:
GUESSINGROWS=n;
statement. You might have some data quality issues in first rows of data?
/Linus
If I know I'm going to be reading the same layout file multiple times I usually take the data step code generated by PROC IMPORT and modify it to reduce such suprises. That way I control any informats, lengths of string variables,
variable names, labels and such.
I did use the same proc import code for reading both the data files.
I figured the issue. In one case all the rows had values for BIRTH_DT, in other data set 10th row was blank. I do not want to discard that row of data since there are other information in the table i would like to use. Do you know if guessingrows will work in such scenario? going to try it out.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.