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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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