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;
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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.