Reorder variables syntax not working properly

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

Reorder variables syntax not working properly

Jeff A

 

Hello everyone,

 

I’ve used the standard method for re-ordering variables for years, but for some reason it’s now failing me. The code example is below.

 

add files file *

  /Keep = x y z etc .

 

It works up until I have about 21 variables that I’m saving and reordering. Some are strings and some numeric (unsure if that matters). As soon as I add the 22nd variable, it stops reordering but does seem to properly keep the listed variables. I’ve experimented with this and it doesn’t seem to be any single variable or type of variable that’s causing the problem.

 

This is occurring on v24 and v25 on two different machines.

 

Is this some type of known bug or limitation ? I can’t see that I’m doing anything wrong and can’t find anything on the web about this matter.

 

Best,

 

Jeff

 

 

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Reorder variables syntax not working properly

Damir Kukec

Try…

 

MATCH FILES FILE = * / KEEP = X Y Z.

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Jeff
Sent: Wednesday, December 26, 2018 12:53 AM
To: [hidden email]
Subject: Reorder variables syntax not working properly

 

 

Hello everyone,

 

I’ve used the standard method for re-ordering variables for years, but for some reason it’s now failing me. The code example is below.

 

add files file *

  /Keep = x y z etc .

 

It works up until I have about 21 variables that I’m saving and reordering. Some are strings and some numeric (unsure if that matters). As soon as I add the 22nd variable, it stops reordering but does seem to properly keep the listed variables. I’ve experimented with this and it doesn’t seem to be any single variable or type of variable that’s causing the problem.

 

This is occurring on v24 and v25 on two different machines.

 

Is this some type of known bug or limitation ? I can’t see that I’m doing anything wrong and can’t find anything on the web about this matter.

 

Best,

 

Jeff

 

 

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD




Under Florida law, e-mail addresses are public records. If you do not want your e-mail address released in response to a public records request, do not send electronic mail to this entity. Instead, contact this office by phone or in writing.
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Reorder variables syntax not working properly

Jon Peck
In reply to this post by Jeff A
The functional effect of ALL followed by other names is just what the first-wins behavior implies as ALL is interpreted as the whole variable list.

On Wed, Dec 26, 2018 at 3:06 PM Rick Oliver <[hidden email]> wrote:
While one might infer from the documentation that "ALL" is equivalent to the first mention for all the remaining variables, it is not explicitly stated. In fact, the documentation says "ALL must be the last specification on KEEP", which is not really the same as everything after ALL is ignored. 

In the case of an explicit duplicate variable name in the list, I see the documented (and expected) behavior. The duplicate entries are ignored, without affecting the reordering of any subsequent variables in the list.

On Wed, Dec 26, 2018 at 3:07 PM Jon Peck <[hidden email]> wrote:
This is documented behavior.  Only the first mention of a variable counts.

On Wed, Dec 26, 2018 at 2:01 PM Jeff <[hidden email]> wrote:

 

I found the problem and Rick pretty much got it. There was a duplicate variable name in my list that I missed. As mentioned, the command runs without errors or warnings and just simply leaves everything as is.

 

The absence of warnings occurs with both add files and /keep on save commands.

 

Thanks

 

Jeff

 

 

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Rick Oliver
Sent: Thursday, 27 December 2018 4:04 AM
To: [hidden email]
Subject: Re: Reorder variables syntax not working properly

 

Curiously the presence of other variables after ALL in the command syntax does not generate any kind of warning or error. The command runs without errors and variables specified after ALL are simply preserved in their original order.

 

On Wed, Dec 26, 2018 at 11:41 AM Jon Peck <[hidden email]> wrote:

Do you, perhaps, have an ALL in the variable list at the point where things go wrong?  That would pick up all the variables other than the ones listed earlier.

 

On Wed, Dec 26, 2018 at 10:17 AM Rick Oliver <[hidden email]> wrote:

With v24, I tried with 50 variables and did not encounter any issues. 

 

***generate random data***.

input program.

loop #i=1 to 100.

do repeat x=var1 to var25.

compute x=trunc(rv.uniform(1,5)).

end repeat.

end case.

end loop.

end file.

end input program.

string str1 to str25 (a2).

do repeat x=str1 to str25.

compute x="ab".

end repeat.

execute.

***use add files to reorder variables***.

add files file=* /keep var1 str1 var2 str2 var3 str3 var4 str4 var5 str5

    var6 str6 var7 str7 var8 str8 var9 str9 var10 str10 var11 str11 var12 str12

    var13 str13 var14 str14 var15 str15 var16 str16 var17 str17 var18 str18

    var19 str19 var20 str20 var21 str21 var22 str22 var23 str23 var24 str24 var25 str25.

execute.

 

 

 

 

On Tue, Dec 25, 2018 at 11:53 PM Jeff <[hidden email]> wrote:

 

Hello everyone,

 

I’ve used the standard method for re-ordering variables for years, but for some reason it’s now failing me. The code example is below.

 

add files file *

  /Keep = x y z etc .

 

It works up until I have about 21 variables that I’m saving and reordering. Some are strings and some numeric (unsure if that matters). As soon as I add the 22nd variable, it stops reordering but does seem to properly keep the listed variables. I’ve experimented with this and it doesn’t seem to be any single variable or type of variable that’s causing the problem.

 

This is occurring on v24 and v25 on two different machines.

 

Is this some type of known bug or limitation ? I can’t see that I’m doing anything wrong and can’t find anything on the web about this matter.

 

Best,

 

Jeff

 

 

 

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


 

--

Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD