BookmarkSubscribeRSS Feed
GDumont
Fluorite | Level 6

Hey, 

I hope everything is alright. 

 

I have a question about proc transpose. Is there any way to use my prefix in idlabel?


For example: 

I have a variable (which i'm using as idlabel) called "sin_date". This variable is a sequence of YYYYMM (202201, 202202, 202203 ...) and I want use a prefix, like "DT_".

When I transpose my numbers, in this moment, my idlabels are 202201, 202202, 202203... and I want that be DT_202201, DT_202202 .. 

 

How can I do this?

Thanks all!

3 REPLIES 3
Tom
Super User Tom
Super User

You cannot do it for LABELS.   You will need to modify the data first and use the new variable in the IDLABEL statement.

 

You could do it for NAMES.  But that uses the ID statement not the IDLABEL statement.

GDumont
Fluorite | Level 6

Ok! 😞

Thanks, Tom! 

ballardw
Super User

A generic comment: what I see seems to imply that you are placing date information into labels and possibly variable names. That sort of wide data set can become quite cumbersome to work with for many tasks as the first step is often something to recover the date information for other uses such as interval calculations.

 

If this data set is made for only the purpose of printing then perhaps one of Proc Report or Tabulate would be in order instead of creating a data set.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 3 replies
  • 1217 views
  • 0 likes
  • 3 in conversation