Searching SAS data sets from Excel - vba

I am trying to find a way to search a sas7bdat file from excel for a specific value, and then copy and paste the data into an excel spreadsheet. Currently I can add the whole data set and then search it in excel, but it would be much better if I could search the data set before adding it to excel, as the data sets are sometimes too large for excel to handle.
Is there a way of doing this? Or alternatively is there a way of running some SAS code from excel that would perform the search for me?
Many thanks,
Alastair

SAS has a Microsoft Office add-in that you can use to connect to SAS datasets from excel. See their product page for more information.
There are a few other options for connecting to SAS as a data source; you can use ODBC for example. You also can do what you describe using DDE. Finally, you can produce excel spreadsheets (but not paste into particular spots, easily anyway) using PROC EXPORT or ODS EXCEL (the latter in 9.4 TS1M2+). You can filter the dataset to the appropriate size prior to exporting.

Related

Excel spreadsheet as parameter for report

Has anyone created a report that could use an Excel spreadsheet attached by the user as a parameter for the report? An example would be a list of potential customers in Excel, and whether they exist or don't exist in the database.
I know something like this is easier to accomplish with a manual SSMS query. However, we have several query requests similar to this which are common requests.
Basically want the user to attach their spreadsheet and compare it with data in the database and then spit out a comparison report.
Use SSIS job to load data from spreadsheet to database and then compare data in usual way with queries.

UNION ALL with Excel file as data source

I have got the following Problem.
I have several Excel files containing each the data of a country in one folder.
However I want to pull that all into one Excel report.
As the content of the source files change dayly, I guess the best way to do that is to do a import via an SQL Statement using Union All.
However the problem is that MSQuery only allows me to Access one file at a time. Is there a Workaround for that problem?
Maybe create a data model and use DAX?
This sounds like a job for Power Query, a free add-in from Microsoft for Excel 2010 and Excel 2013, and built into Excel 2016 as "Get and Transform" in the Data ribbon.
You can create individual queries to the different Excel files in the different folder, then create a query that appends all previous queries into one table, which can be loaded to the Excel data model or a worksheet table for further processing.
The queries can be refreshed with a click when the data has changed.

How can I impoprt data from SAP system to excel using VBA

Can anyone help me out regarding A standard code for importing data from SAP SYSTEM TO EXCEL using VBA. I use SE16 transaction and a table named .I need to import data from TFACS table to excel using vba.
If you have access to SE16n you can export directly from there to csv or text file. You can also get with IT to create a nightly spool that will dump a text file into a folder and then link directly to that file with excel.

Multiple excel sheets import/export to SQL Server

I have to export SQL Serverdata to Excel and edit (make a few changes) later restore it in the data in SQL Server database itself. I have tried doing this manually but can I do this task using SSIS or some other way because I have to do this several times a day.
Googled for this all that I could find was using SSIS which has ability to export/import data of 1 sheet not multiple sheets
Thanks in advance for your answers
In SSIS, in the Excel Source component, you can simply specify the sheet name. You can have multiple Excel Components, or programmatically change the sheet name inside a loop.

Bulk Exporting Non-Tabular Excel Data into a Database

We're facing a massive data migration that consists of about 1500 Excel Spreadsheets that were used to print out data. Because they were designed to be visual, the data is stored in several fields throughout the spreadsheet. I'm looking for a way to map out those fields, and then do a bulk import to bring all of it into a single large table (or series of tables, if needed).
If it was all in a table format, this wouldn't be a problem - but I'm not sure of any way to import, and somehow map the fields to be imported).
Any thoughts or ideas?
If we're speaking in generalities, I'd look at performing this task via a .NET program and use the ACE OLEDB provider to query the Excel data. Then use the language of your choice to parse the data into something more manageable and write to the database. This approach worked well to import some very non-tabular data into SQL Server.
Quick list of SO questions with C# examples of code to query Excel.
How to query excel file in C# using a detailed query
OleDB Read Excel decimal value
Importing excel files in c#