Just use the wanted format:
options locale=Fi_Fi;
data one;
a='30. heinäkuuta 2018 09:52:06';
b=strip(substr(a,1,(length(a)-8)));
c=input(b,nldate20.);
d=c;
format c yymmddd10. d date9.;
run;
proc print data=one noobs;
run;
Result:
a b c d
30. heinäkuuta 2018 09:52:06 30. heinäkuuta 2018 2018-07-30 30JUL2018
Which format you use, or if any format at all, depends on what you want to do later on. If you need the date later on for reference in a where or similar, a format is not needed:
data one;
a='30. heinäkuuta 2018 09:52:06';
b=strip(substr(a,1,(length(a)-8)));
c=input(b,nldate20.);
call symput('c',put(c,best.));
run;
%put c=&c.;
data have; /* build some example data */
format date yymmddd10.;
do date = today() - 10 to today() + 10;
output;
end;
run;
data want; /* select from example */
set have;
where date le &c.;
run;
... View more