Published on :
SAS Functions CREATION_INTERNE

Example of the QTR function

This code is also available in: Deutsch Español Français
Awaiting validation
This script illustrates the use of the SAS© `QTR` function to determine the calendar quarter corresponding to a precise date (April 5, 2063), generated via the `MDY` function.
Data Analysis

Type : CREATION_INTERNE


The data is dynamically generated within the DATA step, without external dependency.

1 Code Block
DATA STEP Data
Explanation :
A simple DATA step that creates the 'pts' table. It calculates the 'Quarter' variable by extracting the quarter from the defined date (Month=4, Day=5, Year=2063).
Copied!
1* Example of the QTR() function. Returns Quarter = 2;
2 
3DATA pts;
4 Quarter = QTR(MDY(04,05,2063))
5;
6RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.