Re: Help with macros

Posted by Eleonora Sidorova on
URL: http://spssx-discussion.165.s1.nabble.com/Help-with-macros-tp5740865p5740885.html

My idea was to create a generic macro that works with SPSS data. I know that mrset removes double codes. but in the course of my work, we often deal with open-ended questions and then send data to other departments that do not work with MRSET. Therefore, the data must be cleaned of double codes. There are many coded open-ended questions included into the data and the number of variables are different each time. In one question they gave 3 answers, in another 10. Therefore, for a macro that I am trying to do, first, it is important to  count the number of variables in the range, and then work with it.
When all the variables are listed, then there are no problems with the macro, but when we write through to, it becomes a problem. Yes, you can list all the variables, but you want to be able to write in different ways.

Example of using future macros:

Using the syntax of Bruce , I can use it for
!test list={q6@1o1 q6@1o2 q6@1o3 q6@1o4 q6@1o5 q6@1o6}.
exe.
!test list={q6a@1o1 q6a@1o2 q6a@1o3}.
exe.
!test list={q2a@1o1 q2a@1o2 q2a@1o3 q2a@1o4 q2a@1o5}.
exe.

But it would be more convenient if I could work with both options.


!test list={q6@1o1 to q6@1o10}.
exe.
!test list={q6a@1o1 to q6a@1o3}.
exe.
!test list={q2a@1o1 to q2a@1o5}.
exe.

Eleonora.