1) no. If you need them, you need them. For clarity, post the code you want an alternative for.
2) with lots of data step and macro coding, as you need to have dynamic code (variable names) depending on the data.
@Best wrote:
Hi,
I have two questions to ask.
1 is there any alternative if firstdot and last dot? Not using group by in proc sql
2 How can we transpose a data set without using Proc transpose?
1) A concrete example of what you are attempting would help. Some techniques might work for some cases but not others because this is very likely to be very dependent on data and result needed.
2) A data step relatively easy will transpose from wide to long
data have;
input a $5. var1 var2 var3;
cards;
19701 8798 123 456
19701 5489 789 333
18054 3578 908 222
;
Run;
data trans;
set have;
array v var1-var3;
do i= 1 to dim(v);
tranval= v[i];
output;
end;
keep a tranval;
run;
from long to wide takes a few more steps to determine max number of resulting variables, create the appropriate variable names, Retain statement and conditional output.
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!
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.