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

Hi All,

Some time i am able to understand DOW with small example. If some thing in complex i am unable to catch up how exactly it is working. I saw couple of code in this forum using DOW approach. In those code they are using more than 2 or 3 do until(last.XXX) after that set have (dataset)

Can some one explain with complex example????

Thanks

Sam

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

BTW: the easiest way, I think, to follow what is going on during the use of any DOW loop, is to insert "putlog _all_;" statements at strategic locations in your code.  That way, you can see exactly what is resulting from every step of the loop(s).

View solution in original post

7 REPLIES 7
mkeintz
PROC Star

I would suggest "The DOW-Loop Unrolled", presented by Paul Dorfman: analytics.ncsu.edu/sesug/2010/BB13.Dorfman.pdf

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
art297
Opal | Level 21

Have you read the following paper: http://support.sas.com/resources/papers/proceedings09/038-2009.pdf

It was written by one of the two individuals who are credited with discovering the concept and explains it via a couple of examples.

art297
Opal | Level 21

BTW: the easiest way, I think, to follow what is going on during the use of any DOW loop, is to insert "putlog _all_;" statements at strategic locations in your code.  That way, you can see exactly what is resulting from every step of the loop(s).

sam369
Obsidian | Level 7

Thank you so much Art and  mkeintz. After reading the those links ...it makes more comfortable , understanding the DOW approach!!!!!!


ballardw
Super User

One of the oddities in the SAS world is refering to a DO UNTIL (usually) program flow structure as DOW.

So what do you call a DO WHILE construct?

I have to admit to having learned a variety of other programming languages before SAS so use of DO UNTIL or WHILE wasn't very confusing. SAS does add a few twists though such as mixing interated and conditional into a single instruction.

art297
Opal | Level 21

It's not the do while, or do if construct that defines the DOW loop but, rather, the effect of placing set statements within a loop.  I'm sure there are other ways of getting SAS to do more than it was intended to do, but we haven't figured that out yet.

mkeintz
PROC Star

And the "w" in DOW is, for some of us, attributable to the fact that many of us learned about it from Ian Whitlock, who taught all of us many things about effective use and understanding of the language constructs in SAS.   Ian was not the first to show the technique, but probably the most influential.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 7 replies
  • 1028 views
  • 6 likes
  • 4 in conversation