Hi, I had this ERROR about dates. I tried with fix dates like 01JAN2012 and 07FEB2018 and works fine. I don't know why SAS doesn't like calculated variables. 34
35 GOPTIONS ACCESSIBLE;
36 %let date=2012-01-01;
37 %let date_d9=%sysfunc(inputn(&date, yymmdd10.), date9.);
38 %put &date_d9.;
01JAN2012
39
40 %let tdate = %sysfunc(today(),date9.);
41 %put &tdate.;
07FEB2018
42
43 PROC SQL;
44 CREATE TABLE WORK.TEST AS
45 SELECT t1.'Instalação'n,
46 t1.Painel,
47 t1.'Último Disparo'n
48 FROM WORK.LISTADISJUNTORESRND t1
49 WHERE t1.'Último Disparo'n BETWEEN 'date_d9.'d AND 'tdate.'d;
ERROR: Invalid date/time/datetime constant 'date_d9.'d.
ERROR: Invalid date/time/datetime constant 'tdate.'d.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
50 quit;
NOTE: The SAS System stopped processing this step because of errors. Regards, Aleixo
... View more