Looks like stacking cols ... this is available as a point and click task in Studio under Tasks->Data->Stack/Split Columns.
Generates something like this:
data work.TestData;
input Col1$ Col2$ Col3 $;
datalines;
A B C
D E F
;
run;
data work.__tmp__;
set WORK.TESTDATA;
_Case_=_n_;
run;
proc transpose data=work.__tmp__ out=work.TestOut(drop=_Label_
rename=(col1=StackedCol)) name=_Level_;
var Col1 Col2;
by _Case_;
run;
proc delete data=WORK.__tmp__;
run;
@Tejaswini3 wrote:
Without transpose statement, pls write code to solve
Why is that? Than you needed to detail your problem a bit. ... let's say just to motivate people. 😉
Err ... being with it: My observation is that you keep on asking the same questions over and over (e.g. here and here ). You got answered there, though you have neither marked these threads as solved nor detailed what was missing to an acceptable solution. ... sooo, could you help us a bit, please?
Should this be a report?
And do not post pictures of data. Ideally, post data step code (with DATALINES) to create a copy of your dataset.
If you need someone to do your work for you, you should hire a consultant.
And you have neither answered my question, nor provided usable data.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.