The dataset is:
data sample;
input FY TC;
datalines;
2013 1
2014 5
2013 6
2015 7
2016 1
2015 5
2016 2
2014 2
2013 7
2014 4
2017 5
2018 1
2018 6
2015 4
2014 2
2015 4
;
Output desired:
FY tc1 tc2 tc3 tc4 tc5 tc6 tc7
2013 1 0 0 0 0 1 1
2014 0 2 0 1 1 0 0
2015 0 0 0 2 1 0 1
2016 1 1 0 0 0 0 0
2017 0 0 0 0 1 0 0
2018 1 0 0 0 0 1 0
The important point in the above output is that there is no data point for TC=3 but I want it in my output dataset, which I need later for calculation in another step. Again this TC=3 data unavailability is just for depiction only and for one particular category (eg. commercial real estate). For other categories, I might have data points missing for TC=4 (e.g. for residential real estate) or so on. So I need a cross table where I can have frequency columns for each from TC=1 to TC=7 irrespective of the fact whether any data point is available for TC=1 to TC=7 or not.
I am well aware of PROC REPORT but it is not creating tables for TC=3. I think it can be done using PROC SQL. Please help me here. I prefer PROC SQL, PROC REPORT as their output can be used easily in a later step.
Not preferred: PROC TABULATE, PROC FREQ