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



Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 214 views
  • 0 likes
  • 2 in conversation