For this dataset only variable A is populated ,I want to create 2 variables date and periods as shown in the excel.The code should be such that once i specify the start date and end date,it should generate all the quarters and their corresponding period starting from zero.In this dataset variable A has 42 values,so if i specify start date as 31-dec-2015 and end date as 31-dec-2020,it should generate all the inbetween quarters as shown in image and also their corresponding quartes.it should also repeat iti.e if Variable A has 42 values it should repeat it twice(42/21)
How are you providing your start/end date. That looks like output, what does your input look like.
What you should be doing is sketched out below - untested.
1. Finding the number of periods you need to create by using your start/end date with the INTCK function
num_quarters = intck('QTR', start_date, end_date);
2. Loop over the number of quarters and increment date
do i= 1 to num_quarters; date = intnx('Quarter', start_date, i, 'b'); OUTPUT; end;
To me only the dataset with variable A is populated.I have been told that start date is 31-Dec-2015 and end date is 31-dec2020.
I have to create a dates coloumn such that all the 21 quarters are populated in a manner as shown in the image file.along with that i have to create a period coloumn as shown in the image
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.