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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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