DEFINE - multiple variables

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

DEFINE - multiple variables

Samir Omerovic
HI to all,

 

Third time Bosnia is asking for some instructions at this list. Two previous were more then
satisfying:) Hope there is solution for this one also.

 

I have (thanks to this list) learned to use DEFINE command. So I am able to make simple syntaxes,
like this one:

 

 

DEFINE test (!POS !CHAREND ('/'))

 

!DO !i !IN (!1)

 

* Custom Tables.

CTABLES

  /VLABELS VARIABLES=!i v4 v3 v1 DISPLAY=DEFAULT

  /TABLE v4 + v3 + v1 BY !i [COLPCT.COUNT F40.1]

  /CATEGORIES VARIABLES=!i v4 v3 v1 ORDER=A KEY=VALUE EMPTY=EXCLUDE.

 

test  v2 v5 v6/.

 

 

The thing becomes interesting if I want to change two variables. For example if I want to repeat the
custom tables from above for some pairs of variables. Is there a way to do that? Instead of changing
the '!i' can I change two variables like '!i' and '!k'... something like that?

 

Thank to all in advance.

 

Samir

 

 

GfK BH

Centar za istrazivanje trzista i javnog mnijenja d.o.o.

 

Samir Omerović

Researcher

 

71 000  Sarajevo, Skenderija 44

Bosna i Hercegovina

 

 

Tel: +387 33 550 300

Fax: +387 33 444 226

www.gfk.ba

www.gfk.com

 

 

 

-----------------------------------------

This e-mail (and any attachment/s) contains confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please notify the sender
immediately  and destroy this e-mail.  Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.

Ova e-poruka sadrzi povjerljive i/ili povlastene podatke. Ako niste osoba naznacena kao primalac
molimo odmah upozoriti posiljaoca i unistiti primljenu e-poruku. Neautorizirano kopiranje,
objavljivanje ili distribucija sadrzaja e-poruke striktno je zabranjeno.

---------------------------------------

 
Reply | Threaded
Open this post in threaded view
|

Re: DEFINE - multiple variables

Mike P-5
Hi Samir,

I think you'll want something like this...

DEFINE !CTABS (CAT = !CHAREND("/") / CLUS =!CHAREND("/") / TITLE = !CMDEND)
        CTABLES
        /VLABELS VARIABLES=!CAT !CLUS DISPLAY= NONE
        /TABLE !CLUS BY !CAT [ROWPCT.COUNT PCT40.2]
        /SLABELS VISIBLE=NO
        /CATEGORIES VARIABLES=!CAT EMPTY=INCLUDE MISSING=EXCLUDE
        /CATEGORIES VARIABLES=!CLUS EMPTY=INCLUDE TOTAL=NO POSITION=AFTER
          /TITLES
   TITLE= !QUOTE(!TITLE).
!ENDDEFINE.

!CtabsTOT CAT = n_1 / CLUS = $Channel / TITLE = Who accesses your PC.

HtH

Mike



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Samir Omerovic
Sent: 15 September 2006 15:28
To: [hidden email]
Subject: DEFINE - multiple variables

HI to all,



Third time Bosnia is asking for some instructions at this list. Two previous were more then
satisfying:) Hope there is solution for this one also.



I have (thanks to this list) learned to use DEFINE command. So I am able to make simple syntaxes, like this one:





DEFINE test (!POS !CHAREND ('/'))



!DO !i !IN (!1)



* Custom Tables.

CTABLES

  /VLABELS VARIABLES=!i v4 v3 v1 DISPLAY=DEFAULT

  /TABLE v4 + v3 + v1 BY !i [COLPCT.COUNT F40.1]

  /CATEGORIES VARIABLES=!i v4 v3 v1 ORDER=A KEY=VALUE EMPTY=EXCLUDE.



test  v2 v5 v6/.





The thing becomes interesting if I want to change two variables. For example if I want to repeat the custom tables from above for some pairs of variables. Is there a way to do that? Instead of changing the '!i' can I change two variables like '!i' and '!k'... something like that?



Thank to all in advance.



Samir





GfK BH

Centar za istrazivanje trzista i javnog mnijenja d.o.o.



Samir Omerović

Researcher



71 000  Sarajevo, Skenderija 44

Bosna i Hercegovina





Tel: +387 33 550 300

Fax: +387 33 444 226

www.gfk.ba

www.gfk.com







-----------------------------------------

This e-mail (and any attachment/s) contains confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately  and destroy this e-mail.  Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Ova e-poruka sadrzi povjerljive i/ili povlastene podatke. Ako niste osoba naznacena kao primalac molimo odmah upozoriti posiljaoca i unistiti primljenu e-poruku. Neautorizirano kopiranje, objavljivanje ili distribucija sadrzaja e-poruke striktno je zabranjeno.

---------------------------------------



________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: DEFINE - multiple variables

Hal 9000
In reply to this post by Samir Omerovic
Hi Samir,

The basic jist of what you want to do is this:

define !BIGMAC = (ARG1 = !charend ('/')
                           /ARG2 = !charend ('/')
                           /ARG3 = !charend ('/'))
*use ARG1, ARG2, ARG3 where you like.
!enddefine.

!BIGMAC ARG1 = v1 v2 v3 /
               ARG2 = v4 v5 v6 /
               ARG3 = v7 v8 v9 /.

If you feel like posting sample data or speaking more about what you're
trying to accomplish, you'll probably get more useful feedback from the
group.
Reply | Threaded
Open this post in threaded view
|

Re: DEFINE - multiple variables

Samir Omerovic
Hi to all again,

 

Thanks Michael and Hal9000 for your replies.

 

Unfortunately I did not manage to make your suggestions work.  I am probably doing something wrong
so let me ask again because if I make this work it will save me a lot of time.

So, I would like to do this:

 

data list list (",") / V1 V2 V3 V4.

begin data

1,2,3,4

2,3,4,1

3,4,1,2

4,1,2,3

end data.

 

 

* Custom Tables.

CTABLES

  /VLABELS VARIABLES=V1 V2 DISPLAY=DEFAULT

  /TABLE V2 [C] BY V1 [C][COUNT F40.0]

  /CATEGORIES VARIABLES=V1 V2 ORDER=A KEY=VALUE EMPTY=EXCLUDE.

 

 

* Custom Tables.

CTABLES

  /VLABELS VARIABLES=V3 V4 DISPLAY=DEFAULT

  /TABLE V3 [C] BY V4 [C][COUNT F40.0]

  /CATEGORIES VARIABLES=V3 V4 ORDER=A KEY=VALUE EMPTY=EXCLUDE.

 

 

 

And many more tables like these two where I change between V1, V2, V3 and V4 in some order. The
Define command workes fine when I want to change one variable at a time so I can make something like
this,

 

DEFINE test (!POS !CHAREND ('/'))

 

!DO !i !IN (!1)

 

 

* Custom Tables.

CTABLES

  /VLABELS VARIABLES=!i V2 DISPLAY=DEFAULT

  /TABLE V2 [C] BY !i [C][COUNT F40.0]

  /CATEGORIES VARIABLES=!i V2 ORDER=A KEY=VALUE EMPTY=EXCLUDE.

 

!DOEND

!ENDDEFINE.

 

 

test V1 V3 V4/.

 

 

But I would like to also have opportunity to change the other variable (V2 in this case) with
different variables. I am trying to get something like this

 

 

* Custom Tables.

CTABLES

  /VLABELS VARIABLES=!i !k DISPLAY=DEFAULT

  /TABLE !k [C] BY !i [C][COUNT F40.0]

  /CATEGORIES VARIABLES=!i !k ORDER=A KEY=VALUE EMPTY=EXCLUDE.

 

 

But what goes before and after this syntax I do not know.

 

All replies are more then welcome.

 

Samir

 

 

 

GfK BH

Centar za istrazivanje trzista i javnog mnijenja d.o.o.

 

Samir Omerović

Researcher

 

71 000  Sarajevo, Skenderija 44

Bosna i Hercegovina

 

 

Tel: +387 33 550 300

Fax: +387 33 444 226

www.gfk.ba

www.gfk.com

 

 

 

-----------------------------------------

This e-mail (and any attachment/s) contains confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please notify the sender
immediately  and destroy this e-mail.  Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.

Ova e-poruka sadrzi povjerljive i/ili povlastene podatke. Ako niste osoba naznacena kao primalac
molimo odmah upozoriti posiljaoca i unistiti primljenu e-poruku. Neautorizirano kopiranje,
objavljivanje ili distribucija sadrzaja e-poruke striktno je zabranjeno.

---------------------------------------

 

  _____  

From: Hal 9000 [mailto:[hidden email]]
Sent: Saturday, September 16, 2006 7:51 PM
To: Samir Omerović; [hidden email]
Subject: Re: DEFINE - multiple variables

 

Hi Samir,

 

The basic jist of what you want to do is this:

 

define !BIGMAC = (ARG1 = !charend ('/')

                           /ARG2 = !charend ('/')

                           /ARG3 = !charend ('/'))

*use ARG1, ARG2, ARG3 where you like.

!enddefine.
 

!BIGMAC ARG1 = v1 v2 v3 /

               ARG2 = v4 v5 v6 /

               ARG3 = v7 v8 v9 /.

 

If you feel like posting sample data or speaking more about what you're trying to accomplish, you'll
probably get more useful feedback from the group.
 
Reply | Threaded
Open this post in threaded view
|

Re: DEFINE - multiple variables

Mike P-5
In reply to this post by Samir Omerovic
You can try something like this - untested

DEFINE tables (seta = !CHAREND ("/")
                    /setb = !CMDEND).

!DO !S !IN (!seta).
!DO !T !IN (!setb).
CTABLES

  /VLABELS VARIABLES=!S !T DISPLAY=DEFAULT
  /TABLE !S [C] BY !T [C][COUNT F40.0]
  /CATEGORIES VARIABLES=!S !T ORDER=A KEY=VALUE EMPTY=EXCLUDE.

!DOEND
!DOEND
!ENDDEFINE.

tables seta = V1 V2 V3 etc / setb = V4 V5 V6 etc.

This is one version but it contains a double loop so might not be what you want, if you have a specific order in which you want to pass your arguments let me know I I'll edit the code accordingly.

HtH

Mike




-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Samir Omerovic
Sent: 19 September 2006 08:48
To: [hidden email]
Subject: Re: DEFINE - multiple variables

Hi to all again,



Thanks Michael and Hal9000 for your replies.



Unfortunately I did not manage to make your suggestions work.  I am probably doing something wrong so let me ask again because if I make this work it will save me a lot of time.

So, I would like to do this:



data list list (",") / V1 V2 V3 V4.

begin data

1,2,3,4

2,3,4,1

3,4,1,2

4,1,2,3

end data.





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=V1 V2 DISPLAY=DEFAULT

  /TABLE V2 [C] BY V1 [C][COUNT F40.0]

  /CATEGORIES VARIABLES=V1 V2 ORDER=A KEY=VALUE EMPTY=EXCLUDE.





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=V3 V4 DISPLAY=DEFAULT

  /TABLE V3 [C] BY V4 [C][COUNT F40.0]

  /CATEGORIES VARIABLES=V3 V4 ORDER=A KEY=VALUE EMPTY=EXCLUDE.







And many more tables like these two where I change between V1, V2, V3 and V4 in some order. The Define command workes fine when I want to change one variable at a time so I can make something like this,



DEFINE test (!POS !CHAREND ('/'))



!DO !i !IN (!1)





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=!i V2 DISPLAY=DEFAULT

  /TABLE V2 [C] BY !i [C][COUNT F40.0]

  /CATEGORIES VARIABLES=!i V2 ORDER=A KEY=VALUE EMPTY=EXCLUDE.



!DOEND

!ENDDEFINE.





test V1 V3 V4/.





But I would like to also have opportunity to change the other variable (V2 in this case) with different variables. I am trying to get something like this





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=!i !k DISPLAY=DEFAULT

  /TABLE !k [C] BY !i [C][COUNT F40.0]

  /CATEGORIES VARIABLES=!i !k ORDER=A KEY=VALUE EMPTY=EXCLUDE.





But what goes before and after this syntax I do not know.



All replies are more then welcome.



Samir







GfK BH

Centar za istrazivanje trzista i javnog mnijenja d.o.o.



Samir Omerović

Researcher



71 000  Sarajevo, Skenderija 44

Bosna i Hercegovina





Tel: +387 33 550 300

Fax: +387 33 444 226

www.gfk.ba

www.gfk.com







-----------------------------------------

This e-mail (and any attachment/s) contains confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately  and destroy this e-mail.  Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Ova e-poruka sadrzi povjerljive i/ili povlastene podatke. Ako niste osoba naznacena kao primalac molimo odmah upozoriti posiljaoca i unistiti primljenu e-poruku. Neautorizirano kopiranje, objavljivanje ili distribucija sadrzaja e-poruke striktno je zabranjeno.

---------------------------------------



  _____

From: Hal 9000 [mailto:[hidden email]]
Sent: Saturday, September 16, 2006 7:51 PM
To: Samir Omerović; [hidden email]
Subject: Re: DEFINE - multiple variables



Hi Samir,



The basic jist of what you want to do is this:



define !BIGMAC = (ARG1 = !charend ('/')

                           /ARG2 = !charend ('/')

                           /ARG3 = !charend ('/'))

*use ARG1, ARG2, ARG3 where you like.

!enddefine.


!BIGMAC ARG1 = v1 v2 v3 /

               ARG2 = v4 v5 v6 /

               ARG3 = v7 v8 v9 /.



If you feel like posting sample data or speaking more about what you're trying to accomplish, you'll probably get more useful feedback from the group.


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: DEFINE - multiple variables

Samir Omerovic
Hi Michael and thanks for reply,


DEFINE tables (seta = !CHAREND ("/")
                    /setb = !CMDEND).

!DO !S !IN (!seta).
!DO !T !IN (!setb).
CTABLES

  /VLABELS VARIABLES=!S !T DISPLAY=DEFAULT
  /TABLE !S [C] BY !T [C][COUNT F40.0]
  /CATEGORIES VARIABLES=!S !T ORDER=A KEY=VALUE EMPTY=EXCLUDE.

!DOEND
!DOEND
!ENDDEFINE.

tables seta = V1 V2 V3 etc / setb = V4 V5 V6 etc.


This works as I expected. The syntax puts each of variables in SETA with each of variables in SETB,
in the custom tables. It suits me fine for what I want.

However, is there a way to also do it in pairs of variables? For example If I want to take V1 and
V4, and then V2 and V5,  and then V3 and V6 and so on...

I have received one more answer from Hillel with following syntax.

* Custom Tables.
DEFINE test (!POS !token(1)
            /!POS !token(1)
            /!POS !token(1))
CTABLES
  /VLABELS VARIABLES=!1 !2 DISPLAY=DEFAULT
  /TABLE !1 [C] BY !2 [C] [COUNT F40.0]
  /CATEGORIES VARIABLES=!1 !2 ORDER=A KEY=VALUE EMPTY=EXCLUDE.
!ENDDEFINE.
test V1 V2 .
test V3 V4 .
test V1 V4 .
test V1 V3  .

This also wroks fine. So these two syntaxes really do solve my problems but being curious I was
wondering if it can also be done in another way...

Thanks once again,


Samir







-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Samir Omerovic
Sent: 19 September 2006 08:48
To: [hidden email]
Subject: Re: DEFINE - multiple variables

Hi to all again,



Thanks Michael and Hal9000 for your replies.



Unfortunately I did not manage to make your suggestions work.  I am probably doing something wrong
so let me ask again because if I make this work it will save me a lot of time.

So, I would like to do this:



data list list (",") / V1 V2 V3 V4.

begin data

1,2,3,4

2,3,4,1

3,4,1,2

4,1,2,3

end data.





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=V1 V2 DISPLAY=DEFAULT

  /TABLE V2 [C] BY V1 [C][COUNT F40.0]

  /CATEGORIES VARIABLES=V1 V2 ORDER=A KEY=VALUE EMPTY=EXCLUDE.





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=V3 V4 DISPLAY=DEFAULT

  /TABLE V3 [C] BY V4 [C][COUNT F40.0]

  /CATEGORIES VARIABLES=V3 V4 ORDER=A KEY=VALUE EMPTY=EXCLUDE.







And many more tables like these two where I change between V1, V2, V3 and V4 in some order. The
Define command workes fine when I want to change one variable at a time so I can make something like
this,



DEFINE test (!POS !CHAREND ('/'))



!DO !i !IN (!1)





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=!i V2 DISPLAY=DEFAULT

  /TABLE V2 [C] BY !i [C][COUNT F40.0]

  /CATEGORIES VARIABLES=!i V2 ORDER=A KEY=VALUE EMPTY=EXCLUDE.



!DOEND

!ENDDEFINE.





test V1 V3 V4/.





But I would like to also have opportunity to change the other variable (V2 in this case) with
different variables. I am trying to get something like this





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=!i !k DISPLAY=DEFAULT

  /TABLE !k [C] BY !i [C][COUNT F40.0]

  /CATEGORIES VARIABLES=!i !k ORDER=A KEY=VALUE EMPTY=EXCLUDE.





But what goes before and after this syntax I do not know.



All replies are more then welcome.



Samir







GfK BH

Centar za istrazivanje trzista i javnog mnijenja d.o.o.



Samir Omerović

Researcher



71 000  Sarajevo, Skenderija 44

Bosna i Hercegovina





Tel: +387 33 550 300

Fax: +387 33 444 226

www.gfk.ba

www.gfk.com







-----------------------------------------

This e-mail (and any attachment/s) contains confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please notify the sender
immediately  and destroy this e-mail.  Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.

Ova e-poruka sadrzi povjerljive i/ili povlastene podatke. Ako niste osoba naznacena kao primalac
molimo odmah upozoriti posiljaoca i unistiti primljenu e-poruku. Neautorizirano kopiranje,
objavljivanje ili distribucija sadrzaja e-poruke striktno je zabranjeno.

---------------------------------------



  _____

From: Hal 9000 [mailto:[hidden email]]
Sent: Saturday, September 16, 2006 7:51 PM
To: Samir Omerović; [hidden email]
Subject: Re: DEFINE - multiple variables



Hi Samir,



The basic jist of what you want to do is this:



define !BIGMAC = (ARG1 = !charend ('/')

                           /ARG2 = !charend ('/')

                           /ARG3 = !charend ('/'))

*use ARG1, ARG2, ARG3 where you like.

!enddefine.


!BIGMAC ARG1 = v1 v2 v3 /

               ARG2 = v4 v5 v6 /

               ARG3 = v7 v8 v9 /.



If you feel like posting sample data or speaking more about what you're trying to accomplish, you'll
probably get more useful feedback from the group.


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For
more information on a proactive anti-virus service working around the clock, around the globe,
visit:
http://www.star.net.uk
________________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

__________ NOD32 1.1698 (20060808) Information __________

This message was checked by NOD32 antivirus system.
http://www.nod32.com
Reply | Threaded
Open this post in threaded view
|

Re: DEFINE - multiple variables

Mike P-5
In reply to this post by Samir Omerovic
Hi Samir,

You could use something like the following, (again untested)

Define !Seta()
V1 V2 V3
!ENDDEFINE.

*Question numbers.
Define !Setb()
V4 V5 V6
!ENDDEFINE.

DEFINE !tables (!POSITIONAL !TOKENS(3)
                   / !POSITIONAL !TOKENS(3))  * The 3 here represents the number of pairs of variables you have.
!LET !vin = !1.
!LET !vout = !2.
!DO !S !IN (!vin).
!LET !vou = !HEAD(!vout).

  /VLABELS VARIABLES=!vin !vou DISPLAY=DEFAULT
  /TABLE !vin [C] BY !vou [C][COUNT F40.0]
  /CATEGORIES VARIABLES=!vin !vou ORDER=A KEY=VALUE EMPTY=EXCLUDE.

!LET !Vout = !TAIL(!Vout)

!DOEND.
!ENDDEFINE.

!Tables !Vques !Vtitles.

Hth
Mike


-----Original Message-----
From: Samir Omerović [mailto:[hidden email]]
Sent: 20 September 2006 08:47
To: Michael Pearmain; [hidden email]
Subject: RE: Re: DEFINE - multiple variables


Hi Michael and thanks for reply,


DEFINE tables (seta = !CHAREND ("/")
                    /setb = !CMDEND).

!DO !S !IN (!seta).
!DO !T !IN (!setb).
CTABLES

  /VLABELS VARIABLES=!S !T DISPLAY=DEFAULT
  /TABLE !S [C] BY !T [C][COUNT F40.0]
  /CATEGORIES VARIABLES=!S !T ORDER=A KEY=VALUE EMPTY=EXCLUDE.

!DOEND
!DOEND
!ENDDEFINE.

tables seta = V1 V2 V3 etc / setb = V4 V5 V6 etc.


This works as I expected. The syntax puts each of variables in SETA with each of variables in SETB, in the custom tables. It suits me fine for what I want.

However, is there a way to also do it in pairs of variables? For example If I want to take V1 and V4, and then V2 and V5,  and then V3 and V6 and so on...

I have received one more answer from Hillel with following syntax.

* Custom Tables.
DEFINE test (!POS !token(1)
            /!POS !token(1)
            /!POS !token(1))
CTABLES
  /VLABELS VARIABLES=!1 !2 DISPLAY=DEFAULT
  /TABLE !1 [C] BY !2 [C] [COUNT F40.0]
  /CATEGORIES VARIABLES=!1 !2 ORDER=A KEY=VALUE EMPTY=EXCLUDE.
!ENDDEFINE.
test V1 V2 .
test V3 V4 .
test V1 V4 .
test V1 V3  .

This also wroks fine. So these two syntaxes really do solve my problems but being curious I was wondering if it can also be done in another way...

Thanks once again,


Samir







-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Samir Omerovic
Sent: 19 September 2006 08:48
To: [hidden email]
Subject: Re: DEFINE - multiple variables

Hi to all again,



Thanks Michael and Hal9000 for your replies.



Unfortunately I did not manage to make your suggestions work.  I am probably doing something wrong so let me ask again because if I make this work it will save me a lot of time.

So, I would like to do this:



data list list (",") / V1 V2 V3 V4.

begin data

1,2,3,4

2,3,4,1

3,4,1,2

4,1,2,3

end data.





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=V1 V2 DISPLAY=DEFAULT

  /TABLE V2 [C] BY V1 [C][COUNT F40.0]

  /CATEGORIES VARIABLES=V1 V2 ORDER=A KEY=VALUE EMPTY=EXCLUDE.





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=V3 V4 DISPLAY=DEFAULT

  /TABLE V3 [C] BY V4 [C][COUNT F40.0]

  /CATEGORIES VARIABLES=V3 V4 ORDER=A KEY=VALUE EMPTY=EXCLUDE.







And many more tables like these two where I change between V1, V2, V3 and V4 in some order. The Define command workes fine when I want to change one variable at a time so I can make something like this,



DEFINE test (!POS !CHAREND ('/'))



!DO !i !IN (!1)





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=!i V2 DISPLAY=DEFAULT

  /TABLE V2 [C] BY !i [C][COUNT F40.0]

  /CATEGORIES VARIABLES=!i V2 ORDER=A KEY=VALUE EMPTY=EXCLUDE.



!DOEND

!ENDDEFINE.





test V1 V3 V4/.





But I would like to also have opportunity to change the other variable (V2 in this case) with different variables. I am trying to get something like this





* Custom Tables.

CTABLES

  /VLABELS VARIABLES=!i !k DISPLAY=DEFAULT

  /TABLE !k [C] BY !i [C][COUNT F40.0]

  /CATEGORIES VARIABLES=!i !k ORDER=A KEY=VALUE EMPTY=EXCLUDE.





But what goes before and after this syntax I do not know.



All replies are more then welcome.



Samir







GfK BH

Centar za istrazivanje trzista i javnog mnijenja d.o.o.



Samir Omerović

Researcher



71 000  Sarajevo, Skenderija 44

Bosna i Hercegovina





Tel: +387 33 550 300

Fax: +387 33 444 226

www.gfk.ba

www.gfk.com







-----------------------------------------

This e-mail (and any attachment/s) contains confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately  and destroy this e-mail.  Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Ova e-poruka sadrzi povjerljive i/ili povlastene podatke. Ako niste osoba naznacena kao primalac molimo odmah upozoriti posiljaoca i unistiti primljenu e-poruku. Neautorizirano kopiranje, objavljivanje ili distribucija sadrzaja e-poruke striktno je zabranjeno.

---------------------------------------



  _____

From: Hal 9000 [mailto:[hidden email]]
Sent: Saturday, September 16, 2006 7:51 PM
To: Samir Omerović; [hidden email]
Subject: Re: DEFINE - multiple variables



Hi Samir,



The basic jist of what you want to do is this:



define !BIGMAC = (ARG1 = !charend ('/')

                           /ARG2 = !charend ('/')

                           /ARG3 = !charend ('/'))

*use ARG1, ARG2, ARG3 where you like.

!enddefine.


!BIGMAC ARG1 = v1 v2 v3 /

               ARG2 = v4 v5 v6 /

               ARG3 = v7 v8 v9 /.



If you feel like posting sample data or speaking more about what you're trying to accomplish, you'll probably get more useful feedback from the group.


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe,
visit:
http://www.star.net.uk
________________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________

__________ NOD32 1.1698 (20060808) Information __________

This message was checked by NOD32 antivirus system.
http://www.nod32.com



________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________