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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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