BookmarkSubscribeRSS Feed
Babloo
Rhodochrosite | Level 12

I came across following questions in interview which I felt stumble to answer. Appreciate if anyone guide me to figure out the answer

 

a) I've 'n' number of datasets (e.g. 1000) in  SAS library. I've to create a report to see total number of observations in each of the SAS dataset under that library. Destinations can be in any format (e.g. HTML or CSV). How to accomplish this?

 

b) I've a dataset called 'customer_sas' in SAS. I've a another table in Oracle called 'customer_oracle'. Now I've to update the table ('customer_oracle') in Oracle by customer id via SAS code. e.g. if customer id is availble in SAS dataset 'customer_sas' and not in Oracle table 'customer_oracle' then we need to update the Oracle table 'customer_oracle'. Now I would like to understand how to read SAS table and then update the Oracle table via SAS.

 

Thanks in advance for any help you offer me.

2 REPLIES 2
Reeza
Super User

1. SASHELP.VTABLE or Dictionary.table - query table based on libname and nobs holds the number of observations. A fairly trivial task to generate the report afterwards. 

 

 

LinusH
Tourmaline | Level 20

For b), there's not enough information to give a detailed answer.

But basically, you can use "any" SAS updata mechanism that supports a transaction table, including data step w update/modify, or SQL update. This via a SAS/ACCESS to Oracle libaname. Another option is to upload the SAs table to Oracle, and write an SQL pass thru to execute the update in Oracle.

Data never sleeps

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!

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
  • 884 views
  • 0 likes
  • 3 in conversation