Hi,
I was wondering if it was possible to have a do loop that satisfies two conditions. For example, in my SAS code:
do SampSize = 5 to 50 by 5;
I want my code to do the above do loop but satisfy the following condition as well:
do SampSize = 60 to 100 by 10;
Is there any way to combine the two conditions (e.g. do SampSize 5 to 50 by 5 and SampSize = 60 to 100 by 10)?
Thanks,
Tim
Try:
Data A;
Do SampSize= 5 To 50 By 5, 60 To 100 By 10;
Output;
End;
Run;
If you are looking for an IML solution, then the data step syntax above will not work. Other solutions would be to have two loops or save all the values of SamSize in a vector as follows:
ss = do(5,50,5)||do(60,100,10);
do i = 1 to ncol(ss);
SampSize=ss[i];
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.