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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.