Hi All,
So I have what I feel like should be a simple task, but I just can't figure it out.
I am working with very large dataset stores on Oracle servers and need to use the data for a variety of Tableau dashboards. The datasets are so large that working off a live feed from the Oracle servers isn't feasible, so we have to create subsets of the data and either connect live to those, or create extracts.
What I would like to do is set it up so that every time my code runs it selects the last 1 year of data, relative to the date that the code is run. Right now it is set up to pull anything over a pre-specified date, but obviously as the date gets further away the larger the dataset becomes and I don't want to have to worry about going in and changing it overy so often.
Here is the code I tried:
data SUBSET; set ORIGINAL;
where EVENT_REPORTED_DATETIME >= (%sysfunc(DATETIME(),datetime20.) -365);
run;
It results in the following error:
NOTE: Line generated by the macro function "SYSFUNC". 1 07DEC2016:11:10:26 ------- 22 76 ERROR: Syntax error while parsing WHERE clause. ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, ), *, **, +, -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, GE, GT, IN, IS, LE, LIKE, LT, NE, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=. ERROR 76-322: Syntax error, statement will be ignored.
I tried a few other similar methods, but they either returned no observations or all observations.
... View more