How to add input box to sas sql query which ask user about parameter?

前端 未结 2 1602
盖世英雄少女心
盖世英雄少女心 2021-01-28 17:10

How to add input box to sas sql query which ask user about parameter ? (Something aka Access input box) (in Enterprise Guide)

2条回答
  •  天涯浪人
    2021-01-28 18:13

    Here is a solution using BASE -

    You could use the %Window procedure with the %display

    DATA _NULL_;
    %LET BATCH1=;
    
    %WINDOW BATCH_ANALYSIS COLOR = WHITE        
    
    ICOLUMN = 30 IROW = 11
    COLUMNS = 88 ROWS = 20
    
      #1 @28 "CLIENT BATCH REPORT"
      #4 @12 "Date must be entered YYYY-MM-DD Format, ascending order."
      #6 @28 "Example = '2015-01-31'"
      #9 @5 "Enter Batch Date - [ENTER] when complete:"       
      #11 @5 BATCH1 12 attr=underline
      #13 @5 "Reports will be written to 'location'";
    
    %DISPLAY BATCH_ANALYSIS;
    STOP;
    RUN;
    
    %put %batch1;
    

    This above is an example of using the "user input" to operate on your query/data step. In this case, I am prompting the user to enter a date, which creates that string value as a macro variable that can be passed anywhere in your SAS code (I am only using the string date format because it gets passed to an RSUBMIT in a DB2 environment). May be a good idea to play with the Input Lines/etc to display the text you want in your prompt window...

提交回复
热议问题