SAS: Can't paste text into user input prompt (using %WINDOW)

时间:2015-10-30 21:47:23

标签: input user-controls sas

I am wondering if there is any way to allow a user to paste text into a user input prompt created using the %WINDOW statement. For example, a simple code in the SAS documentation is as follows:

/** %WINDOW defines the prompt **/
%window info
  #5 @5 'Please enter userid:'
  #5 @26 id 8 attr=underline
  #7 @5 'Please enter password:'
  #7 @28 pass 8 attr=underline display=no;

/** %DISPLAY invokes the prompt **/
%display info;

%put userid entered was &id;
%put password entered was &pass;

I have something similar but one of the fields asks for the user to put in the path to a certain folder (like C:\MyDocuments\2015\TestFolder). The path can be pretty long and for some reason I cannot paste the path name into the user input field. Is there some SAS option that would allow this?

1 个答案:

答案 0 :(得分:1)

You could auto-populate the field from the clipboard using a macro variable generated via a previous data step, I suppose. If I remember the syntax correctly:

filename temp clipbrd;

data _null_;
  infile temp;
  input;
  call symput('LONGVAR',_INFILE_);
run;

filename temp clear;

This would require the user to have copied the file path to the clipboard before running the code that reads it from the clipboard and opens the window.