Background: I have one row record.
and the expexted result is as follow:
Is there ant methods to perform it efficiently in SAS DI?
As I have tried using transpose transformation and it just allows me to transpose one column to one output column each time, i.e, I need to perform the transformation 2 times to achieve the above results.
Post test data in the form of a datastep in a code window (its the {i} above post area). At a guess:
data have;
x1="a"; x2="b"; x3="c"; x4="d";
run;
data want (keep=want:);
set have;
array vals{4} x:;
do i=1 to 4 by 2;
want1=vals{i};
want2=vals{i+1};
output;
end;
run;
Sorry I am using sas di tools not sas code
I would try SAS/IML. Would you like IML code ?
data want (drop = i);
do i = 1 to 2;
input name $ @;
input name1 $ @;
output;
end;
cards;
a b c d
;
run;
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 save with the early bird rate—just $795!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.