SUPPORT / SAMPLES & SAS NOTES
 

Support

Sample 24619: Determine the week number of the year

DetailsCodeResultsAboutRate It

Use the INTNX and INTCK functions to determine the week of the year (1 through 52 or 53) for a specified date.

Note:   The INTCK function returns the integer number of time intervals in a given time span. By default, Sunday is the beginning of the week interval. Use 'shift intervals' to change the starting day for the interval. See the SAS Language Reference, Dictionary for under functions for more details.

The INTNX function increments (either forwards or backwards) a date, time or datetime value by a specified interval.

See the SAS Language Reference, Dictionary under Functions for more details.

Beginning in SAS 9.1, the WEEK function can be used as an alternative approach and is documented in the SAS NLS User's Guide.




These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.