Desktop productivity for business analysts and programmers

User Input Interface (user forms to input data)

Reply
Occasional Contributor
Posts: 13

User Input Interface (user forms to input data)

Hi!
I have a script which extracts a set of information from our SAS Database using SAS EG (a combination of Data steps and Proc SQL).

If I need to change my input parameters (for examlpe data interval etc.) I must change my script manually.

Is there an oppotunity to set variable values using some sort of user forms in VBA when you just submit your script with dialog box appearing. Here you can either confirm your default values or input new ones. It allows to utilize you script for use by ordinary users who are not familiar with SAS programming.
Frequent Contributor
Frequent Contributor
Posts: 94

Re: User Input Interface (user forms to input data)

EG has this ability built in. For example:

In a blank project, create a new code object with the below:

[pre]
data test;
format date1 date9.;
format date2 date9.;

date1 = "&date1."d;
date2 = "&date1."d;
run;
[/pre]

Go to Tools -> Parameters Manager. Add the variables named "date1" and "date2". Set the type of both as a Date, and check the options for "Prompt at value" and "A value is required at runtime".

Go back to Project Designer, right click on the code object, and choose properties. Under parameters, hit Add, and select the two macro variables you added earlier.

Hit OK and run the project, and EG should prompt you for the values. The resulting dataset will be as selected.

You can set descriptions and other limitations if required, and even use the values in the other EG functions.

Have a look at: http://analytics.ncsu.edu/sesug/2007/HW02.pdf for more info. It'll probably explain it better than I can!

Hope that helps.
Ask a Question
Discussion stats
  • 1 reply
  • 896 views
  • 0 likes
  • 2 in conversation