Dear All,
I have a program some thing like below (and the file is added to a source control)
%let data = source.adsl;
%let var = age;
%let proc_to_run = mean;
%macro procs();
%if &proc_to_run eq mean %then %do;
proc means data = &data;var &var;run;
%end;
%else %if &proc_to_run eq freq %then %do;
proc freq data = a;table &var;run;
%end;
%else %put selected procedure is invalid;
%mend;
%procs;
To, change the parameter values I need to check out and check in the program every time.
To avoid that, i taught to enter the values during the execution time by prompting a window with three parameters.
One for input dataset, second is for analysis variable and third is for procedure to execute (by listing the available procedures).
I found the below code on net,
** This code is for the SAS windowing environment only. **/
/** %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;
Which is suitable for windows environment. Is there anyway to achieve the same in UNIX environment ?
Thanks,
Venkat.
Did you try it? It has always worked for me.
Make sure that you are using X-windows and not just dumb terminal.
Hi Tom,
I tried but that is not working when I run on unix server.
Can you provide some more details about the x-windows and how you have achieved...
Thanks in Advance,
Venkat.
How are you starting SAS. Normally I open a X terminal window on the UNIX server (running sas xterm, dtterm, etc).
When you do that you should have an environment variable named DISPLAY that should look something like hostname:n where hostname is the name of the host where your X Windows Server software is running and the number after the colon is which screen on that X windows server your terminal is running. Then to run SAS interactively you just type the command sas at the command prompt.
If instead you just have a X windows server running, but you are not running a X windows compatible terminal window then you might need to add the -display option to the command line to tell SAS what X windows screen to open the interactive SAS windows.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.