BookmarkSubscribeRSS Feed
shree
Calcite | Level 5

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.

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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).

ballardw
Super User

@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.

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

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
  • 2 replies
  • 624 views
  • 0 likes
  • 3 in conversation