I have attached a screenshot of the question. Please help me figure this out, i'm very lost.
1. read the source data using 2 data steps
data table1;
infile datalines ..
input ...
datalines;
your data
;
run;
2. Concatenate
Either use Proc Append or a third data step
3. Interleaving
First sort your data sets by Flavor
Here the detailed docu with code examples of how you can combine SAS data sets
I'm not sure that I understand the term "cake brand" but you can check next code:
data Duncan;
length flavor $15;
infile datalines dlm=',' truncover;
input flavor $ height;
datalines;
Devil's food ,39
Devil's food ,36.5
White ,30.5
White ,34.5
Yellow , 37.0
Yellow , 35.0
run;
data Betty;
length flavor $15;
infile datalines dlm=',' truncover;
input flavor $ height;
datalines;
Devil's food ,35.5
Devil's food ,36.0
White ,35.5
White ,37.5
Yellow , 32.5
Yellow , 32.5
run;
data all;
set duncan
betty indsname=_dsn;
by flavor;
brand = scan(_dsn,2,'.');
run;
title 'Duncan & Betty results';
proc print data=all;
var brand flavor height;
run;
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.