I have a job that is erroring out at the very end, and getting an error at the keyword "WHERE". It's using a Subquery to extract the most recent row processing date, and using that date as a filter for bringing in the source data. Below is the code that is erroring out:
from
bnkDbDataGov.V_DMI_CIF_Daily as V_DMI_CIF_Daily,
(
select
MAX(V_DMI_CIF_Daily_sub.DWDATE_Int ) as Max_Date
from
bnkDbDataGov.V_DMI_CIF_Daily as V_DMI_CIF_Daily_sub
)
where
V_DMI_CIF_Daily.DWDATE_Int = Max_Date
);
%rcSet(&sqlrc);
disconnect from ODBC;
quit;
Would you like to share the log with the complete code and error massages? That wouldgreatly help others Help you.
Cheets Jan.
In your code
from
bnkDbDataGov.V_DMI_CIF_Daily as V_DMI_CIF_Daily,
(
select
MAX(V_DMI_CIF_Daily_sub.DWDATE_Int ) as Max_Date
from
bnkDbDataGov.V_DMI_CIF_Daily as V_DMI_CIF_Daily_sub
)
where
V_DMI_CIF_Daily.DWDATE_Int = Max_Date
);
From what you post the last ) does not have a matching ( .
The log is always a good idea as it is often pretty good about showing where issues are.
Attached is the log, and the error is occurring at row 1320
The "disconnect from ODBC" tells me that the problem i s probably related to some syntax within your (guessing here) ...from connection to-block. So technically, it may not be a SAS issue.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.