A SAS developer builds a macro %LOAD_DATA that accepts a table name and caslib. The macro should execute different code paths depending on whether the CAS table already exists. Which macro function checks for CAS table existence before loading?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — b is correct because the correct pattern for checking CAS table existence in a SAS macro is to call the CAS table.tableExists action via PROC CAS, capture the result code (1=exists, 0=does not exist) into a macro variable using SYMPUTX, and then use %IF to branch. %SYSFUNC(EXIST()) checks SAS library tables, not CAS tables.
Full explanation below image
Full Explanation
B is correct because the correct pattern for checking CAS table existence in a SAS macro is to call the CAS table.tableExists action via PROC CAS, capture the result code (1=exists, 0=does not exist) into a macro variable using SYMPUTX, and then use %IF to branch. %SYSFUNC(EXIST()) checks SAS library tables, not CAS tables. A is wrong; EXIST() does not check CAS in-memory tables. C is wrong; %SYMEXIST checks macro variable existence, not data table existence. D is wrong; PROC CASUTIL LIST does not automatically populate macro variables with table names.