BookmarkSubscribeRSS Feed
Daily1
Quartz | Level 8

data have;
input var1 $ var2 $ var3 ;
datalines;
A 2012 20
B 2019 30
C 2023 40
D 2024 50
;
run;

 

 

i want 

Daily1_0-1653646134855.png

 

4 REPLIES 4
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
Daily1
Quartz | Level 8

 

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

Daily1_0-1653647520681.png

it is possible?

PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
Daily1
Quartz | Level 8
What happens to var1 var2 and var7, why aren't they used in the desired output? this is the problem i want to solution.
var1 var2 and var7 is present but no needed to result this columns

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 946 views
  • 1 like
  • 2 in conversation