I have a really large dataset that looks like this:
ID A B C -- ZZ A_new B_new C-new -- ZZ_new
1 0 1 1 -- 1 1 1 0 0
I want to perform a test of agreement between all variables of the same name + the suffix
proc freq data=dat;
table A*A_new / agree;
table B*B_new / agree;
I dont think we can use an array to do a SAS procedure - but is there another way to do this without have to write down every variable name?
So what I did was concatenate the text to trigger the macro for all the variables in my data:
select cat('%mymacro(',name, ',', cats(name, '_new' ),')') into :renstr separated by ' ' from
dictionary.columns where libname = 'WORK' and memname='DATA';
Then I just copied and pasted the result into my SAS code....
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.