BookmarkSubscribeRSS Feed
deleted_user
Not applicable
data tran
input acc date $ emi dpd;
cards;
101 nov08 90 0
101 dec08 80 1
101 jan09 45 0
102 nov08 89 0
102 dec08 89 1
102 jan09 78 2
run;


Hi i am having a dataset i wnat to transpose this but i wnat to transpose two variable .i wnat the output like this


acc nov08 dec08 jan09 nov_emi dec_emi jan_emi
101 90 80 45 0 1 0
102 89 89 78 0 1 2


i have done by transposing emi and then i have taken another datset and again traspose the dpd then i have merged it.

But i wnat this in Transpose
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Appears you have multiple, unique PREFIX= requirements for your transposed variables, therefore you must consider two PROC TRANSPOSE executions with a DATA step to MERGE the outputs together creating the columns you have listed.

Below is a link to one of several technical/conference papers found on the SAS support http://support.sas.com/ website to consider.

Scott Barry
SBBWorks, Inc.

Changing the Shape of Your Data: PROC TRANSPOSE vs. Arrays
Bob Virgile, Robert Virgile Associates, Inc.
http://www2.sas.com/proceedings/sugi24/Begtutor/p60-24.pdf

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 898 views
  • 0 likes
  • 2 in conversation