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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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