SQALEX101
SQALEX101

Reputation: 229

SAS EG prompt to upload file during process flow

Relatively new to SAS Enterprise Guide. I'm looking for a way to prompt the user to upload a file during the process flow execution. The file will be used in the next steps of the process flow.

Is this possible? What alternatives are available?

Upvotes: 1

Views: 268

Answers (1)

Robert Penridge
Robert Penridge

Reputation: 8513

SAS doesn't appear to support 'native' calls to file open dialog boxes, but it does allow you to make calls to the Windows API which provides the common file picker dialog box you see everywhere.

You will need to make use of the sascbtbl filename and calls to modulec in order to do so. I'm putting this answer here as a stub for the moment and will try and expand on it next week.

In the meantime, here's an example of how to use the above to get the current process ID (PID) in windows:

filename sascbtbl "%sysfunc(pathname(work))\sascbtbl.txt" lrecl=500;

data _null_;
  file sascbtbl;
  infile datalines;
  input;
  put _infile_;
datalines4;
routine GetCurrentProcessId
   minarg=0
   maxarg=0
   stackpop=called
   callseq=byvalue
   module=kernel32;
;;;;
run;

%let current_sas_process_id = %sysfunc(modulen(*e,GetCurrentProcessId));
%put &current_sas_process_id;

The above is the basic approach you will need to take but instead of call the GetCurrentProcessId class you will probably need to call the FileOpenDialog class or something like that (which is more complicated as it takes parameters).

Upvotes: 0

Related Questions