Given the following SQL procedure output:
Table Physical Obs % Deleted
EMPLOYEE_ADDRESSES 424 5.0%
EMPLOYEE_PAYROLL 424 5.0%
Which SQL query will produce a report for tables in the ORION library which have had at least 5% of
their physical rows deleted, as shown above?
A. select MEMNAME 'Table', NOBS 'Physical Obs', DELOBS/NOBS '% Deleted' format=percent6.1
from dictionary.tables
where LIBNAME='ORION' AND DELOBS/NOBS >= .05;
B. select Table_Name, Num_Rows 'Physical Obs', Deleted_Rows/Num_Rows '% Deleted' format=percent6.1
from dictionary.DBA_TABLES
where TABLESPACE_NAME='ORION' AND Deleted_Rows/Num_Rows >= .05;
C. select MEMNAME 'Table', NLOBS 'Physical Obs', DELOBS/NLOBS LABEL='% Deleted' format=percent6.1
from dictionary.tables
where LIBNAME='ORION' AND DELOBS/NLOBS >= .05;
D. select MEMNAME 'Table', NOBS 'Physical Obs', DELOBS/NOBS LABEL='% Deleted' format=percent6.1
from dictionary.members
where LIBNAME='ORION' AND DELOBS/NOBS >= .05;
correct_answer = "A"
Why the choice "C" is wrong? To me it looks like both the choices "A" and "C" are correct. Can someone please explain why the choice "C" is incorrect.
The L in NLOBS means "logical". That's how many observations are logically in the data set. The value includes all observations minus the number of deleted observations.
That would be the wrong denominator to use for computing percentages.
The L in NLOBS means "logical". That's how many observations are logically in the data set. The value includes all observations minus the number of deleted observations.
That would be the wrong denominator to use for computing percentages.
Thank you for answering the question.
I haven't noticed L in NLOBS and reading it as NOBS. Thought there might be some mistake with LABEL which I am not able to figure out.
Anyways, got it now. Thanks Again!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.