data have;
input var1 $ var2 $ var3 ;
datalines;
A 2012 20
B 2019 30
C 2023 40
D 2024 50
;
run;
i want
What is the column named Sr? How does it get a value of 1?
What is the second column, how does it get a name of 2012? Why is the first value underneath 2012 equal to 20?
We need to understand how the desired output can be created from the original data; right now it makes no sense to me.
Please show us a longer desired output from PROC REPORT or PROC TABULATE. It is impossible to generalize from a single row of output.
data have;
input var1 $ var2 $ var3 var4 $ var5 var6 $ var7;
datalines;
A 2012 20 55 36 85 63
B 2019 30 13 14 55 55
C 2023 40 52 54 33 55
D 2024 50 96 37 66 23
;
run;
i want
it is possible?
I'm sure it is possible, which brings up the question ... var3 var4 var5 aren't the real names are they? You have some meaningful names instead of var3 var4 var5 like CANADA, FRANCE, SPAIN.
What happens to var1 var2 and var7, why aren't they used in the desired output?
Can you explain more about what this data is?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.