Hi All,
I would like to know if there is a way to dynamically increase or decrease the no. of input texts in a window statement dynamically. There are many scenarios in which we would have varying no. of inputs. For example, the task of access providing would be very cumbersome if we had to do so one at a time. But in the window statement we have a way to get as many inputs as possible (maximum being 10).
I wanted to be able to enter a number first and then subsequently get a window displaying the same no. of input lines, i.e; If I enter 5, I should get a window that has 5 inputs. Kindly advice.
Thanks and regards,
Prithviraj
Hi All,
I have found the solution to my problem.
The sample program is as follows:
%window studyn
#5 @5 "Enter number of studies"
@40 numstud 3 attr = underline
required = yes;
%display studyn;
%macro study_in;
%do i=1 %to &numstud;
#%eval(2+&i) "Enter Study &i:" @20 study&i 8
attr = underline required = yes
%end;
%mend study_in;
%window studyn
%study_in;
;
%display studyn;
What I have done here is I have created a primary window where I need to input a number of studies that I would like to input. Once I enter a specific number, a second window should open displaying exactly the same number of inputs as the number I entered in the first window. I utilized an external macro in the %Window statement in order to achieve the same.
Thanks and regards,
Prithviraj
Yes Cynthia,
I am indeed talking about the window and %window statements.
In a normal window or % window statement, we would need to specify a number of input text lines in the program. I would like to be able to vary the same dynamically, i.e; display a primary window where I can input a number, and then subsequently open another window which displays the same no. of input lines as the number we input in the primary window.
Please advice.
Thanks and regards,
Prithviraj
It would likely help to show what kind of Window statement you are currently using.
Also indicate what needs to change and what kind of range it needs to handle.
Since the number of items displayed can affect size there are going to be a number of factors involved.
Perhaps a %window may help.
Hi Cynthia,
You mentioned that the %Window statement was an old methodology. What do you mean?
Are there better alternatives to this method? I am using a Unix environment to run SAS 9.1.
Kindly advice.
Thanks and regards,
Prithviraj
Hi All,
I have found the solution to my problem.
The sample program is as follows:
%window studyn
#5 @5 "Enter number of studies"
@40 numstud 3 attr = underline
required = yes;
%display studyn;
%macro study_in;
%do i=1 %to &numstud;
#%eval(2+&i) "Enter Study &i:" @20 study&i 8
attr = underline required = yes
%end;
%mend study_in;
%window studyn
%study_in;
;
%display studyn;
What I have done here is I have created a primary window where I need to input a number of studies that I would like to input. Once I enter a specific number, a second window should open displaying exactly the same number of inputs as the number I entered in the first window. I utilized an external macro in the %Window statement in order to achieve the same.
Thanks and regards,
Prithviraj
Hi Cynthia,
Its true I have a program process for which I am taking prior inputs. However I would not be able to provide information on the same.
However my objective is simple:
(I)Collect a number (in this case it would be the number of input lines required) in the primary window
(II)Display the same number or required input lines in a second successive window
Thanks and regards,
Prithviraj
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.