DATA Step, Macro, Functions and more

to get the list of common dataset

Reply
Learner
Posts: 1

to get the list of common dataset

I have a folde location where there are n numbers of datasets .

1)I want to get the list of all the datasets with common string as xx in one table and the datset with common string as yy in other table.

2)I want to append the data of all the datasets of xx table to one oracle table and all the data of datasets of yy table in other oracle table.

#) before step 2 it should check the availability of dataset in folder and all the columns are same to target oracle table or not.

Super User
Super User
Posts: 7,401

Re: to get the list of common dataset

This is a Q&A board, it sounds like you have a whle process you want someone o do for your, so maybe consider hiring a contractor.  If you have specific questions, then please provide test data - in the form of a datastep - which describes what you have, show what you want out, and define the logic between the two.  For instance this text "atasets with common string as xx in one table" - what does it refer to, dataset name, some data in the table, something else?  As for checking columns are the same, you can create a dataset of the OC strcuture with something like:

proc sql;
  connect to oracle (...);
  create table OC_STRUCT as
  select * from connection to oracle (
    select * 
    from   DICTIONARY.COLUMNS
    where ...;);
  disconnect from oracle;
quit;

Of cours that is pass through to return the structure from dictionary tables, you can then compare this to the columns found in sashelp.vcolumn where libname you specify.  (note the code above is just an example as you have provided no information on what your doing).

Super User
Posts: 10,490

Re: to get the list of common dataset


shree wrote:

I have a folde location where there are n numbers of datasets .

1)I want to get the list of all the datasets with common string as xx in one table and the datset with common string as yy in other table.

 


Is the string XX in a dataset name? A variable Name? A variable Label? The value of a variable? How about YY? What you are looking for depends on where you will have to look.


shree wrote:

 

2)I want to append the data of all the datasets of xx table to one oracle table and all the data of datasets of yy table in other oracle table.

 


In SAS dataset = table. A table does not have datasets. And now you bring in Oracle. Was that supposed to be in the first part of the question?

 

I think you need to rethink your requirements and then be more explicit about the 1) the environment you need to search (what I can find in SAS about SAS data sets may not be anywhere near as simple to find out about Oracle tables/variables/ metadata)

2) Exactly what you are searching - metadata, names (and of what) or values

3) Provide some examples of what you are searching for and what the results should actually look like. Example data should be in form of datastep code to complete describe any variables involved.

Ask a Question
Discussion stats
  • 2 replies
  • 89 views
  • 0 likes
  • 3 in conversation