BookmarkSubscribeRSS Feed
rajvaidya
Calcite | Level 5

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.

4 REPLIES 4
LinusH
Tourmaline | Level 20

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

Data never sleeps
ballardw
Super User

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.

rajvaidya
Calcite | Level 5

I did use the same proc import code for reading both the data files.

rajvaidya
Calcite | Level 5

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 787 views
  • 0 likes
  • 3 in conversation