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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.