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;


 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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