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!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.