From the course: SAS® 9.4 Cert Prep: Part 10 Manipulating Data with Functions

Unlock this course with a free trial

Join today to access over 22,500 courses taught by industry experts.

Shifting date values

Shifting date values

- [Instructor] Let's look at another problem you can solve with functions. Suppose you have a table that includes transaction dates and you want to create a column for billing that shifts the dates to the first day of the following month. You can use the INTNX function for adjusting and shifting date values. You specify an interval such as week, month, year, or many others, as the first argument, and the name of a SAS date column at the second argument. The third argument is the increment number which represents the number of intervals to shift the value of the start date. The optional fourth argument controls the position of SAS dates within the interval. Let's look at this in a demo and see how different values for each of the arguments impacts the dates that are returned.

Contents