1
votes

I'm creating a stored process in SAS EG for some business partners, but I can't seem to get my dataset to output.

A 'Results' viewer shows up but is blank, and my code works perfectly fine when not using a stored process, but the user has to manually change the macro variable for the account they are looking for. With a stored process I can mitigate users accidentally deleting some code, etc.

I can see in my SAS log that the output dataset is being created with variables and observations, but it doesn't automatically pop up like a typical SAS EG job would. I also have some documentation I received from a co-worker around stored processes, and it seems to me that after successful execution a SAS dataset should automatically output.

One thought: Will a stored process output a dataset if there are warnings in the log? I have warnings presented because I am appending datasets to a base file that isn't created, so the lengths of my numeric variables change.

Here's a snippet from the log..

    NOTE: The address space has used a maximum of 5504K below the line and 222716K above the line.


104        
105        data tran_last;
106             retain TRAN_DT MRCH_NAME MRCH_CITY AMT_TRAN DEB_CRD_IND;
107        set tran_sorted;
108        output;
109        run;

                                                                                          The SAS System

NOTE: There were 164 observations read from the data set WORK.TRAN_SORTED.
NOTE: The data set WORK.TRAN_LAST has 164 observations and 5 variables.
NOTE: The DATA statement used 0.00 CPU seconds and 51817K.

NOTE: The address space has used a maximum of 5504K below the line and 222716K above the line.

The data set WORK.TRAN_LAST is the dataset I wish to be output so that my user can directly copy/paste from there, maybe I'm missing something apparent, but I can't seem to figure this out.

Version 7.1

enter image description here

1
I'm testing it before I give it out, I've never created one of these before. I am executing it from the project tree, a prompt box appears where I choose an account ID. SAS is pulling and processing the same amount of observations and variables that I expect, as per the log, but no 'Output Data' tab appears like on a typical sas EG job. A 'results' tab will pop up which is generally created from using proc print, but I'm not using proc print, and the 'results' tab is blank. I just want 'output data' tab to appear like it normally does so the user can copy/paste what they need.DukeLuke
Hmm... Maybe. It's definitely in the WORK folder. The issue is that the end-users are not very tech savvy and are in an operational environment, this is just some ad-hoc(ish) type work they need to do occasionally for historical data that isn't available in their typical systems, so I need to make this as easy for them as possible, hence why I want the 'output data' tab to appear as this is executed.DukeLuke
@joe yes it is always the same. It's just a giant TRAN file that is appended from months/years of data for a specific accountDukeLuke
I don't know if I exactly follow.... but if I understand you correctly, they will not be creating their own projects...I will send my project out to the analysts, who will then run whichever program they need, and input the date range/acct ID for the customer they wish to pull information on. I don't know how to add the dataset to the process flow, it's not even in the process flow now....DukeLuke
Oh - maybe work folder in stored process isn't seeable? Try writing it to external Libname also defined in project's spaceJoe

1 Answers

1
votes

The answer was extremely simple. I had to use

PROC PRINT DATA = MYDATA ;
RUN;

at the end of my stored procedure.

However, I have books from the SAS Institute that say you can retrieve an "Output Data" file from a stored procedure instead of the "Results Viewer" using proc print. This functionality must have been taken out with newer versions, or maybe I was doing something wrong.

To fix this issue, I have my SAS connected to an excel file that the end-user will run the program(s) from so that they won't need to worry about the output being "Results Viewer".