BookmarkSubscribeRSS Feed
phoenix31
Fluorite | Level 6

Creation of macros to run proc univariate on multiple tables from the ODBC (Oracle Server) and saving this in a single table.

 

I have around 40 tables in a particular schema on the Oracle server and would like to run Proc univariate on all the numeric fields from the tables and save it in a single table.

 

I know this is limited information, but I wanted to start with the high level and provide more information based on the updates I receive.

Thank you so much!

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Write a macro that loops through all of the Oracle tables and performs PROC UNIVARIATE on it, with results being stored in a SAS data set. In the same loop, append each SAS data set to the previous (PROC APPEND).

--
Paige Miller
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Much like @PaigeMiller you have provided the high level, so nothing further for us to comment on.  

If it was me doing it I would break it down as:

1) Get data from database and save to SAS datasets in a given library.

2) Generate the code from SASHELP.VTABLE, something like:

data _null_;
  set sashelp.vtable (where=(libname="YOURLIB"));
  call execute('proc univariate....;
                    proc append base=...);
run;

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 796 views
  • 2 likes
  • 3 in conversation