As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.
Here are some tips for How to share your SAS knowledge with your professional network.
Solutions in the Round -- INTX, INTNX, and INTCK
From the WUSS abstract for this topic
The INTX, INTNX and INTCK functions are powerful and useful. Join us as we discuss best practices for using these functions. Solutions in the Round is an exciting new section [at WUSS 2014]. The format is simple: we sit in a circle and discuss the many ways to approach and address a programming problem, and we'll identify situations where one approach might be more useful than another. We will keep notes, and those notes will be posted on sasCommunity.org where we can continue the discussion and allow other to join in after the conference. We hope to engage users from all different perspectives and experience levels to participate in these discussions.
Discussion at WUSS
Well, the first thing that I learned as section chair was that INTX is not a SAS function! Oops! This topic was chosen because searches for these terms on sasCommunity.org and communities.sas.com are among the most popular. Fortunately, some experts joined this discussion and saved the day. We were especially thankful for the participation of Derek Morgan, author of The Essential Guide to SAS Dates and Times.
- INTCK -- counts # of intervals
- INTNX -- advance # of intervals
INTNX(qtr, datec, -6, 'B'); /*B M E S*/ YRDIF(d1, d2, 'age'); /*birthdt, today()*/
- YRDIF -- thoughts: fixed in 9.3, age function instead
- don't assume that you want the defaults
- NESUG paper: can someone find this paper? Something about SUBSTR is wrong?
- difference between two dates
- use subtraction
- intervals, enhanced
- Macro Date Loop (Fehd)
- Macro Do Loops with Dates (Fehd)
- Paper 343-2013 Writing Macro Do Loops with Dates from Then to Now Ronald J. Fehd, SAS-L peer, Atlanta, GA, USA
Further Discussion -- Open to All
Please join the conversation! Also, if you were one of the live participants, please feel free to correct any mistakes or omissions from our original discussion.
- First of all, my apologies for the delay in posting this to the site -- several months after the conference. It was a lot of fun to host this section and to collaborate in such a free-formatted section, and I hope that we can continue the discussion here. As the section chair, and in hopes of breaking the ice, I challenged myself to propose the worst solution to every problem. I think that it is important to identify the full spectrum of solutions to a problem, so that we can also identify the things that we are trying to avoid. Also, we can all agree that there is usually not just one solution that fits every single problem. In most cases, we would like a solution that avoids processing through every record on the dataset. However, in cases where there is very little data, this is not always necessary. I look forward to hearing others' thoughts. Cheers, --Otterm1 (talk) 10:58, 30 December 2014 (CST)