BookmarkSubscribeRSS Feed
chennupriya
Quartz | Level 8

Hi All,

I have a problem when i run a sas code it will delete the current table and insert into same table like in example below but the problem is its changing all the dates format to 1960-01-01 05:38:21.000 

 

can anyone pls help 

i have used below query 

proc sql;
delete from sqldb.xy;
insert into sqldb.xy
select * from price.yz
;
quit;

2 REPLIES 2
ballardw
Super User

By any chance is any of this data in another database such as Oracle, DB2 or SQL server?

 

There are a lot of systems out there that say something is a "date" but is actually a datetime. The specific value you show makes me beleive that you actually have a date, 08/01/2015, as a value being inserted into something that is expecting a datetime value.

chennupriya
Quartz | Level 8

yes you are rite but for first time its working fine and loading correct dates i mean 

PROC SQL;
CREATE TABLE sqldb.xy  AS
SELECT 
FROM price.yz;
quit;

/*inorder to update table in sql */

proc sql;
delete from sqldb.xy;
insert into sqldb.xy
select * from price.yz
;
quit;

 

for the first time ia m using proc sql create table in sql but once the table is created in sql then when i run second time i am just deleteing table and inserting rows into same table but when i am doing secong procedure teh dtae format changes pls explain 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 798 views
  • 0 likes
  • 2 in conversation