BookmarkSubscribeRSS Feed
Anju
Calcite | Level 5

HI All, I am trying to update the format for only the timestamp and make it 00:00:00 without changing the date, Please can you suggest some formats I can try in the Pass through update I posted below

 

Have - 

data have;
input bus_date datetime25.;
format bus_date datetime25.;
datalines;
25DEC2020:16:12:18
.
;
run;

 

Want - 

bus_date 25DEC2020:00:00:00

 

 

proc sql;
connect to oracle as myconn (user=smith password=secret
path='myoracleserver');

execute
(
update have
set
bus_date=???
where
STATUS = '0'
) by ORACLE;

disconnect from myconn;
quit;

1 REPLY 1
Reeza
Super User

This is an Oracle question not SAS question since you're using SQL pass through the 
SQL needs to be Oracle compliant.

 

Try the TRUNC() function.

 

bus_date=trunc(bus_date)

@Anju wrote:

HI All, I am trying to update the format for only the timestamp and make it 00:00:00 without changing the date, Please can you suggest some formats I can try in the Pass through update I posted below

 

Have - 

data have;
input bus_date datetime25.;
format bus_date datetime25.;
datalines;
25DEC2020:16:12:18
.
;
run;

 

Want - 

bus_date 25DEC2020:00:00:00

 

 

proc sql;
connect to oracle as myconn (user=smith password=secret
path='myoracleserver');

execute
(
update have
set
bus_date=???
where
STATUS = '0'
) by ORACLE;

disconnect from myconn;
quit;


 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1106 views
  • 0 likes
  • 2 in conversation