05-14-2017 07:46 AM - edited 05-14-2017 07:47 AM
few days back i have attended an interview, the interviewer asked a question:-
consider a case, there are 50 libraries, each libraries has some sas datasets. so i want to list only those sasdatas which has a column or variable X in all the sas datasets from all the libraries?????
plzz help me
05-14-2017 09:07 AM - edited 05-14-2017 09:08 AM
Ok in this case, sashelp.vcolumns will help us. in this we could check all the libraries, datasets and the variables they have.
in your case check like this
This will subset on the list of libraries(libname) and datasets (memname) that have variable with name X.
05-14-2017 09:12 AM - edited 05-14-2017 09:42 AM
Alternatively by proc sql also we could achieve the same result
proc sql; create table want as select libname, memname , name from dictionary.columns where name='X'; quit;
05-14-2017 09:34 AM
They wanted to know if you're familiar with Dictionary tables.
You can find details in many papers on LEXJANSEN.COM
Create data dictionary
Automate creation of labels or rename variables