BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Steelers_In_DC
Barite | Level 11

I am currently using this: proc datasets lib=tran1214 nolist;contents data=_all_ noprint out=MDJ.tran1214;quit;run;

I can search the output to find a table that has one or several variables that I need to use.  There is one table that has a corrupted table so it will not work.  I would like to do something like this (this does not work)

proc datasets lib=wbdw nolist;

contents data = ABS_02PORTFOLIO_CONVERSION  ;

contents data = ACLS_CONCENTRATION_FACT  ;

contents data = ACLS_CUSTOMER_DIMENSION  ;

contents data = ACLS_LOAN_DIMENSION  ;

contents data = AGENDA_ACTIVITY_DIM  ;

contents data = AGENDA_ATTEND_FACT  ;

contents data = AGENDA_CONTACT_FACT  ;

currently I'm taking this output with several hundred tables and putting it into excel to search for variables.  Is there a way to list multiple datasets rather than _all_?

I'm using the output to feed into this:

proc sql;

     create table WANT as

     select DISTINCT MEMNAME

     from &check_lib

     where    

/*MEMNAME in (select distinct MEMNAME from &check_lib where upcase(NAME)="ACCT_PARTICIPATED_AMT") AND*/

/*MEMNAME in (select distinct MEMNAME from &check_lib where upcase(NAME)="ACCT_CUST_INTEREST_BAL_AMT") AND*/

/*MEMNAME in (select distinct MEMNAME from &check_lib where upcase(NAME)="ACCT_FEE_CURRENT_PAYOFF_AMT") AND*/

/*memname in (select distinct MEMNAME from &check_lib where upcase(NAME) contains "DEFAULT_DATE_END") AND*/

MEMNAME in (select distinct MEMNAME from &check_lib where upcase(NAME) contains "PD");

quit;

I've tried a few things with no viable solutions, any help will be appreciated.

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

You want to use your SQL on the special SAS DICTIONARY.COLUMNS.

Use this to see the description:

proc sql;

describe table dictionary.columns;

quit;

and then something search the dictionary table to find the memnames with the columns you need. Specify the LIBNAME='YOURLIBGOESHERE' in the where clause.

you could drop all of the UPCASE functions as the LIBNAME, MEMNAME and NAME variables are all upper case in the dictionary tables.

View solution in original post

3 REPLIES 3
ballardw
Super User

You want to use your SQL on the special SAS DICTIONARY.COLUMNS.

Use this to see the description:

proc sql;

describe table dictionary.columns;

quit;

and then something search the dictionary table to find the memnames with the columns you need. Specify the LIBNAME='YOURLIBGOESHERE' in the where clause.

you could drop all of the UPCASE functions as the LIBNAME, MEMNAME and NAME variables are all upper case in the dictionary tables.

Steelers_In_DC
Barite | Level 11

Thanks

Doc_Duke
Rhodochrosite | Level 12

Just delete the corrupted table.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1180 views
  • 0 likes
  • 3 in conversation