BookmarkSubscribeRSS Feed
skatethejake
Fluorite | Level 6

Hello,

 

I have this data that I want to transpose.

 

The data looks like this

 

 

Name

Jake 

Sophomore

Name

Abigail

Senior

Name

Ronny

Freshman

 

I have been trying to create a count where it will display a unique identifier for each group of info like this

Name 1

Jake 1

Sophomore 1 

Name 2

Abigail 2

Senior 2

Name 3

Ronny 3

Freshman 3

 

I can only seem to create a count that starts over when the name row appears, hence it goes 1,2,3 instead of 1,1,1 for each group of data. Any help would be much appreciated

 

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Why do you want to transpose this?

 

data want;
    set have;
    if string='Name' then count+1;
run;
--
Paige Miller
skatethejake
Fluorite | Level 6
I'm an idiot lol, thank you so much. I really appreciate this.

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 737 views
  • 1 like
  • 2 in conversation