Hi!
Long post warning. Let's talk for a bit about DATA and RESULTS.
When you use the SAS Add-in for Microsoft Office, in Excel, you can OPEN data into an Excel worksheet. SAS Data files are your data stored in a proprietary format that is a rectangular structure of rows and columns. This rectangular structure is stored, internally, in a proprietary format. Here are some of the characteristics of a SAS data set:
-- A SAS data set contains data
-- a SAS data set MIGHT have a description, but does NOT have a TITLE
-- SAS data set variables can be either character or numeric.
-- SAS stores information about how each column of information should be formatted -- but within fairly simple limits. For example, the SALES column can be formatted with the DOLLAR14. format; the JOBCODE column could be formatted with a user-defined format called $JCODE., etc. SAS formats do NOT include anything that has to do with colors and fonts.
-- A SAS data set does NOT have page breaks
-- A SAS data set can only be viewed with SAS or with some product, like the SAS Add-in for Office or the SAS System Viewer or with EG, that "knows" how to open and display a SAS data structure in a readable format.
When you analyze or describe or otherwise perform tasks on SAS data sets, you are using some "procedures" behind the scenes that produce RESULTS. Here are some of the characteristics of RESULTS:
-- RESULTS have titles
-- RESULTS have footnotes
-- depending on the output type or destination, RESULTS may have page breaks (for example, PDF has page breaks, but HTML does not have page breaks)
-- RESULTS can have color and font specifications (For example, column headers can be bold and be placed on a purple background, but the data cells can be placed on an orange background -- garish as that may be).
-- RESULT files generally have a specific kind of viewer or rendering software that you use ...for example, PDF result files are best viewed with Adobe Reader; RTF result files are best viewed with Microsoft Word or a word processor; HTML files are best viewed with a browser; SASReport XML result files are best viewed with SAS Web Report Studio.
Sometimes, when you perform your analysis or task or run a SAS procedure, you can EITHER get a SAS dataset as output from your analysis OR you can get a RESULT file (a report) from your analysis. When you are running stored processes, USUALLY, you are producing RESULTS and not DATA SETS.
So, why did I go on and on about this? Because when you say: "I have a stored process with a proc print statement and expect the results dataset to be displayed directly into excel." That single statement highlights the salient point that will dictate the answer to your question.
When you use PROC PRINT, you are NOT creating a "results dataset" -- you are creating a RESULT REPORT, probably in SASReport or HTML format (depending on your SAS Options for Excel). The fundamental difference between datasets and results is the reason for your inability for display 1500 rows at a time. A SAS data set is defined in the metadata -- it has a location where it lives on a disk device someplace. Therefore, Excel can ask SAS to "serve up" 1500 or 2000 rows of the data at a time. On the other hand, a RESULT report from PROC PRINT in a stored process is not data -- it does not live on a disk device in a form that can be "served up" in chunks. Generally, stored process results come back as STREAMING output -- via the connection between your client application and SAS on the server. One of the characteristics of STREAMING output is that it comes back in one stream.
When you try to open a big DATA SET into an Excel worksheet, SAS serves up the DATA records or rows in chunks, based on your options. When you try to run a stored process that will return a big RESULTS file or report, Excel will give you a message that says:
[pre]
SAS has generated a results file (...name of temp file here...) that is 11371 KB in size, which is larger than the limit specified on the Results tab of SAS Add-in Options (1000 KB). This file could take several minutes to open.
[/pre]
(all the numbers in the above message are based on my test case and my options)
Notice, that nowhere on this message is there a reference to a SAS data set. When you open SAS --> Options in Excel, the number of RECORDS to be served up is on the DATA tab. The default is 500. The way to change how RESULTS get returned is on the RESULTS tab .. .you can the FORMAT (SASReport, HTML or CSV) of the report results, the STYLE of the report results and whether you want to be prompted if results file exceeds a certain size -- the default value is 1000 KB. I never change this default value because I have found that I do not generally have the patience to look at very many report rows at a time.
OK, so back to your question. PROC PRINT is just "printing" or creating a report for a SAS dataset. The value that PROC PRINT is adding is the ability to have titles and footnotes and summary lines. All very nice. But, if your stored process is creating a dataset and then doing a PROC PRINT on that dataset, perhaps you would be better off, creating the dataset in a permanent library and then using Excel to access that data set as a data set (and thus, go through the data set rows or records 1500 rows at a time).
At this point, I have to comment that perhaps your stored process might be written differently -- returning HUGE result/report files is generally not something that stored process users are willing to wait for. If you want the data points in Excel, then have your stored process create a data set that the users can then access. This might require a bit of setup work to make sure that the data set is registered in the metadata, but the setup is well worth the ability to serve up the data in chunks.
There are ways that you could write your stored process to test the results of your query and do some conditional processing. But I don't know whether your stored process has parameters or what your stored process is trying to accomplish. At this point, you might need some debugging help from Tech Support. The problem, it seems to me, is that your stored process might need some fine turning or other programming logic in order to return either a manageable report result (from PROC PRINT) or a big data set (which can then be opened in Excel).
Sorry for going on so long. I hope this helps.
cynthia