BookmarkSubscribeRSS Feed
Ypss
Calcite | Level 5

Hi

I have a dataset that looks like this:

abcde
13579
246810

How to change it to:

CharacterNumber
a1
a2
b3
b4
c5
c6
d7
d8
e9
e10

Thank you in advance!

3 REPLIES 3
mohamed_zaki
Barite | Level 11

data have;

input a b c d e;

cards;

1 3 5 7 9

2 4 6 8 10

;

run;

proc transpose data=have out=have;

run;

proc transpose data=have out=have;

by _name_;

run;

Loko
Barite | Level 11

Hello,

A data step solution:

data have;
input a b c d e;
datalines;
1 3 5 7 9
2 4 6 8 10
;

data want;
set have;
array vars{*} a--e;
do i=1 to dim(vars);
character=vname(vars{i});
number=vars{i};
output;
end;

keep character number;
run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 927 views
  • 1 like
  • 4 in conversation