This is my first post on this forum and I'd like to kindly ask you to assist me with this problem.
In Enterprise Guide I'm writing an SQL statement in which I wan't to (in the select part) get the difference in days between two date values. Both date values/columns are in yyyymmdd format. Unfortunatelly, the standard sql DATEDIFF function is not working here and I've tried DATDIF but with no luck.
It tried something like this:
CREATE TABLE EGTASK.MYQUERY
AS SELECT DATDIF (START_DATE, END_DATE, 'ACT/ACT'), ...
If START_DATE and END_DATE are character values, those need to be converted to numeric SAS date values before calling DATDIF. One way to convert a character value to a numeric value is to use the INPUT function.
Here is a small program that uses the INPUT function and the YYMMDD. informat to convert character date values into numeric date values.