BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello,

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;
cards;
03-2023 10 20 30 40
04-2023 20 10 30 10
05-2023 40 30 20 20
;
Run;

proc transpose data=have out=want;
var  _all_;
run; 
1 REPLY 1
yabwon
Onyx | Level 15

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: www.polsug.com and communities.sas.com/polsug

"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



SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1 reply
  • 341 views
  • 0 likes
  • 2 in conversation