BookmarkSubscribeRSS Feed
Meteorite | Level 14


I am using proc transpose to change data structure from wide to long.

It is working 100%  and I also get a column called _LABEL_.

In this column (_LABEL_)  I get the label values .

In my real code which contain many columns (150 columns)  I perform also same proc transpose code  but I don't get the _Label_ column.

May anyone explain why it can happen?

As I said I run same code (proc tranpose) but dont get _label_ column

data have;
label month='MM-YYYY'  X='weight' y='height' Z='direction' R='revenue';
input month $ X Y Z R;
03-2023 10 20 30 40
04-2023 20 10 30 10
05-2023 40 30 20 20

proc transpose data=have out=want;
var  _all_;
Meteorite | Level 14

Does your "real" data have any variables with labels?

Run proc contents on your dataset an in the section variables see if there are any labels.

If there is no label in the data proc transpose won't produce _label_ variable.

Polish SAS Users Group: and

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2 in conversation