data grund;
format proces_start proces_slut datetime23.2;
proces_start = '23APR2019:11:30:19.400'dt;
proces_slut = '30APR2019:08:09:11.300'dt;
brutto_time_diff_sek = proces_slut-proces_start;
run;
/* This table only contains working days */
data kalender;
format begin datetime23.2;
begin='17APR2019:00:00:00.000'dt;
output;
begin='23APR2019:00:00:00.000'dt;
output;
begin='24APR2019:00:00:00.000'dt;
output;
begin='25APR2019:00:00:00.000'dt;
output;
begin='26APR2019:00:00:00.000'dt;
output;
begin='29APR2019:00:00:00.000'dt;
output;
begin='30APR2019:00:00:00.000'dt;
output;
begin='01MAY2019:00:00:00.000'dt;
output;
run;
OPTIONS INTERVALDS=(XKALENDER=KALENDER);
/*I expect the result to be 419.400 sec.*/
PROC SQL;
CREATE TABLE resultat AS SELECT *
,INTCK('XKALENDER', PROCES_START, PROCES_SLUT) AS PROCES_NETTO_SEK format=commax18.2
,INTCK('XKALENDER', PROCES_START, PROCES_SLUT)*86400 AS PROCES_NETTO_SEK1
FROM grund;
quit;