Hi I have below dataset:
ID Value
1 A,B,C
2 D,E,F,G,H
I want output as below:
ID Value
1 A
1 B
1 C
2 D
2 E
2 F
2 G
2 H
Can somebody help me with this.??
data want;
set have;
do i=1 to countw(value,',');
newvalue=scan(value,i);
output;
end;
drop i value;
run;
data want;
set have;
do i=1 to countw(value,',');
newvalue=scan(value,i);
output;
end;
drop i value;
run;
@Son_Of_Krypton wrote:
How we can do without using do loop.??
What is wrong with a loop? That is one of the basic tools for dealing with multiple similar items.
@Son_Of_Krypton wrote:
How we can do without using do loop.??
With great difficulty, if it even is possible at all.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: