BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rohit_95
Calcite | Level 5

Please explain how the do until loop as shown in the picture iterates to give the output as show in the other picture.

y.pngx.png

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

DO UNTIL means that the loop iterates until the condtion IS true.

On the first iteration X=5 so that is less than 50 so the loop continues. On the second iteration X=10 which is also less than 50, etc.

View solution in original post

5 REPLIES 5
Shmuel
Garnet | Level 18

The code X+5; (whithout the equal = sign) means: start with 0 and add 5 at each iteration.

 

do until (x>50); means to stop loop at the given condition.

rohit_95
Calcite | Level 5
but at x=5 or any value less than 50 the statements within the do group shouldn't get executed but it is getting executed and that is my doubt.
Tom
Super User Tom
Super User

DO UNTIL means that the loop iterates until the condtion IS true.

On the first iteration X=5 so that is less than 50 so the loop continues. On the second iteration X=10 which is also less than 50, etc.

Tom
Super User Tom
Super User

SAS code is just simple text. Paste in the text so that it is readable and can be copied.  Use the Insert SAS code icon to get a pop-up window where you can paste the code so that it retains its formatting.

 

Posting photogrpahs of text takes longer than pasting the actual text. So it is a waste of your time and of the readers time.

Reeza
Super User

As someone else mentioned, please post input and output as text, not images. 

 


@rohit_95 wrote:

Please explain how the do until loop as shown in the picture iterates to give the output as show in the other picture.

y.pngx.png


 

sas-innovate-2024.png

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.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1279 views
  • 2 likes
  • 4 in conversation