Reorder vars with one variable first, then all others in file order

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

Reorder vars with one variable first, then all others in file order

John F Hall

I have 32 files with variable [year] as the last variable.  I needed to save them with [year] as the first variable followed by all other variables in their original order.  In the FM: SAVE OUT doesn't help.  I didn't fancy having to drag the last variable manually to the top of the file and/or typing out a list of <var> to <var> for each file, so I tried:

 

GET

  FILE='C:\Users\John Hall\Desktop\ input\bsa2016.sav'.

 

 DATASET NAME DataSet66 WINDOW=FRONT.

 

SAVE OUT 'C:\Users\John Hall\Desktop\ bsa2016x.sav'.

/keep year all.

 

It works!

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

===================== 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 vars with one variable first, then all others in file order

David Marso-2
Yep. A very obvious solution for anyone who has barely browsed the FM. Congrats.

=====================
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 vars with one variable first, then all others in file order

John F Hall
Final solution is included in:
https://surveyresearch.weebly.com/british-social-attitudes-making-files-from-different-years-compatible.html
This will make all files for the British Social Attitudes Survey directly downloadable from the links provided, plus the Natcen reports available on-line for 2009 to 2016, plus the version of the spss mother file with no cases.  Thanks to Jon Peck for that brilliantly effective solution to the data safeguarding problem, but I'm also quite chuffed about testing successfully, despite churlish appreciation from (? Fellow insomniac and beer freak?) DM:
SAVE OUT "<pathway>\<targetfile>.sav"
    /KEEP year ALL
If you are a Laurel and Hardy fan, you might also like:
https://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/bsas_2016_on_the_trail_of_the_lonesome_nine_s_.pdf
Happy weekend everyone

John F Hall  MA (Cantab) Dip Ed (Dunelm)
[Retired academic survey researcher]

Email:          [hidden email]
Website:     Journeys in Survey Research
Course:       Survey Analysis Workshop (SPSS)
Research:   Subjective Social Indicators (Quality of Life)

-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of David Marso
Sent: 28 September 2018 13:02
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

Yep. A very obvious solution for anyone who has barely browsed the FM. Congrats.

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Reorder vars with one variable first, then all others in file order

Zdaniuk, Bozena-3
this is brilliant! And one can add any number of variables prior to "All" . I have waited years for that!!
thanks to all.
bozena
________________________________________
From: SPSSX(r) Discussion [[hidden email]] on behalf of John F Hall [[hidden email]]
Sent: Friday, September 28, 2018 9:07 AM
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

Final solution is included in:
https://surveyresearch.weebly.com/british-social-attitudes-making-files-from-different-years-compatible.html
This will make all files for the British Social Attitudes Survey directly downloadable from the links provided, plus the Natcen reports available on-line for 2009 to 2016, plus the version of the spss mother file with no cases.  Thanks to Jon Peck for that brilliantly effective solution to the data safeguarding problem, but I'm also quite chuffed about testing successfully, despite churlish appreciation from (? Fellow insomniac and beer freak?) DM:
SAVE OUT "<pathway>\<targetfile>.sav"
    /KEEP year ALL
If you are a Laurel and Hardy fan, you might also like:
https://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/bsas_2016_on_the_trail_of_the_lonesome_nine_s_.pdf
Happy weekend everyone

John F Hall  MA (Cantab) Dip Ed (Dunelm)
[Retired academic survey researcher]

Email:          [hidden email]
Website:     Journeys in Survey Research
Course:       Survey Analysis Workshop (SPSS)
Research:   Subjective Social Indicators (Quality of Life)

-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of David Marso
Sent: 28 September 2018 13:02
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

Yep. A very obvious solution for anyone who has barely browsed the FM. Congrats.

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Reorder vars with one variable first, then all others in file order

Rick Oliver
The ability to reorder a subset of variables to the front of the variable order with KEEP VARLIST ALL had been around a long time, and it is available on multiple commands, including GET, SAVE, ADD FILES, and MATCH FILES. 

On Fri, Sep 28, 2018 at 12:52 PM Zdaniuk, Bozena <[hidden email]> wrote:
this is brilliant! And one can add any number of variables prior to "All" . I have waited years for that!!
thanks to all.
bozena
________________________________________
From: SPSSX(r) Discussion [[hidden email]] on behalf of John F Hall [[hidden email]]
Sent: Friday, September 28, 2018 9:07 AM
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

Final solution is included in:
https://surveyresearch.weebly.com/british-social-attitudes-making-files-from-different-years-compatible.html
This will make all files for the British Social Attitudes Survey directly downloadable from the links provided, plus the Natcen reports available on-line for 2009 to 2016, plus the version of the spss mother file with no cases.  Thanks to Jon Peck for that brilliantly effective solution to the data safeguarding problem, but I'm also quite chuffed about testing successfully, despite churlish appreciation from (? Fellow insomniac and beer freak?) DM:
SAVE OUT "<pathway>\<targetfile>.sav"
    /KEEP year ALL
If you are a Laurel and Hardy fan, you might also like:
https://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/bsas_2016_on_the_trail_of_the_lonesome_nine_s_.pdf
Happy weekend everyone

John F Hall  MA (Cantab) Dip Ed (Dunelm)
[Retired academic survey researcher]

Email:          [hidden email]
Website:     Journeys in Survey Research
Course:       Survey Analysis Workshop (SPSS)
Research:   Subjective Social Indicators (Quality of Life)

-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of David Marso
Sent: 28 September 2018 13:02
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

Yep. A very obvious solution for anyone who has barely browsed the FM. Congrats.

=====================
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
===================== 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 vars with one variable first, then all others in file order

Zdaniuk, Bozena-3
I am sure it has been. And I wish I had asked the right question years ago. I think I usually asked a general question on how to reorder variables and was given an advise of writing them out in a desired order on the /KEEP subcommand which was not practical when dealing with hundreds of variables. Again, thanks to all who share the nuggets of wisdom here.
bozena

From: Rick Oliver [[hidden email]]
Sent: Friday, September 28, 2018 11:17 AM
To: Zdaniuk, Bozena
Cc: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

The ability to reorder a subset of variables to the front of the variable order with KEEP VARLIST ALL had been around a long time, and it is available on multiple commands, including GET, SAVE, ADD FILES, and MATCH FILES. 

On Fri, Sep 28, 2018 at 12:52 PM Zdaniuk, Bozena <[hidden email]> wrote:
this is brilliant! And one can add any number of variables prior to "All" . I have waited years for that!!
thanks to all.
bozena
________________________________________
From: SPSSX(r) Discussion [[hidden email]] on behalf of John F Hall [[hidden email]]
Sent: Friday, September 28, 2018 9:07 AM
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

Final solution is included in:
https://surveyresearch.weebly.com/british-social-attitudes-making-files-from-different-years-compatible.html
This will make all files for the British Social Attitudes Survey directly downloadable from the links provided, plus the Natcen reports available on-line for 2009 to 2016, plus the version of the spss mother file with no cases.  Thanks to Jon Peck for that brilliantly effective solution to the data safeguarding problem, but I'm also quite chuffed about testing successfully, despite churlish appreciation from (? Fellow insomniac and beer freak?) DM:
SAVE OUT "<pathway>\<targetfile>.sav"
    /KEEP year ALL
If you are a Laurel and Hardy fan, you might also like:
https://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/bsas_2016_on_the_trail_of_the_lonesome_nine_s_.pdf
Happy weekend everyone

John F Hall  MA (Cantab) Dip Ed (Dunelm)
[Retired academic survey researcher]

Email:          [hidden email]
Website:     Journeys in Survey Research
Course:       Survey Analysis Workshop (SPSS)
Research:   Subjective Social Indicators (Quality of Life)

-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of David Marso
Sent: 28 September 2018 13:02
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

Yep. A very obvious solution for anyone who has barely browsed the FM. Congrats.

=====================
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
===================== 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 vars with one variable first, then all others in file order

John F Hall
In reply to this post by Rick Oliver

Rick

The point is that you can put one or more variables before ALL.  This is not in the FM.  At least BNzenia understands..

John

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Rick Oliver
Sent: 28 September 2018 20:18
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

 

The ability to reorder a subset of variables to the front of the variable order with KEEP VARLIST ALL had been around a long time, and it is available on multiple commands, including GET, SAVE, ADD FILES, and MATCH FILES. 

 

On Fri, Sep 28, 2018 at 12:52 PM Zdaniuk, Bozena <[hidden email]> wrote:

this is brilliant! And one can add any number of variables prior to "All" . I have waited years for that!!
thanks to all.
bozena
________________________________________
From: SPSSX(r) Discussion [[hidden email]] on behalf of John F Hall [[hidden email]]
Sent: Friday, September 28, 2018 9:07 AM
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

Final solution is included in:
https://surveyresearch.weebly.com/british-social-attitudes-making-files-from-different-years-compatible.html
This will make all files for the British Social Attitudes Survey directly downloadable from the links provided, plus the Natcen reports available on-line for 2009 to 2016, plus the version of the spss mother file with no cases.  Thanks to Jon Peck for that brilliantly effective solution to the data safeguarding problem, but I'm also quite chuffed about testing successfully, despite churlish appreciation from (? Fellow insomniac and beer freak?) DM:
SAVE OUT "<pathway>\<targetfile>.sav"
    /KEEP year ALL
If you are a Laurel and Hardy fan, you might also like:
https://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/bsas_2016_on_the_trail_of_the_lonesome_nine_s_.pdf
Happy weekend everyone

John F Hall  MA (Cantab) Dip Ed (Dunelm)
[Retired academic survey researcher]

Email:          [hidden email]
Website:     Journeys in Survey Research
Course:       Survey Analysis Workshop (SPSS)
Research:   Subjective Social Indicators (Quality of Life)

-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of David Marso
Sent: 28 September 2018 13:02
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

Yep. A very obvious solution for anyone who has barely browsed the FM. Congrats.

=====================
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

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Reorder vars with one variable first, then all others in file order

Jon Peck
From the ADD FILES documentation for /KEEP

The keyword ALL can be specified on KEEP. ALL must be the last specification on KEEP, and it refers to
all variables not previously named on that subcommand. It is useful when you want to arrange the
first few variables in a specific order.

On Fri, Sep 28, 2018 at 12:54 PM John F Hall <[hidden email]> wrote:

Rick

The point is that you can put one or more variables before ALL.  This is not in the FM.  At least BNzenia understands..

John

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Rick Oliver
Sent: 28 September 2018 20:18
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

 

The ability to reorder a subset of variables to the front of the variable order with KEEP VARLIST ALL had been around a long time, and it is available on multiple commands, including GET, SAVE, ADD FILES, and MATCH FILES. 

 

On Fri, Sep 28, 2018 at 12:52 PM Zdaniuk, Bozena <[hidden email]> wrote:

this is brilliant! And one can add any number of variables prior to "All" . I have waited years for that!!
thanks to all.
bozena
________________________________________
From: SPSSX(r) Discussion [[hidden email]] on behalf of John F Hall [[hidden email]]
Sent: Friday, September 28, 2018 9:07 AM
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

Final solution is included in:
https://surveyresearch.weebly.com/british-social-attitudes-making-files-from-different-years-compatible.html
This will make all files for the British Social Attitudes Survey directly downloadable from the links provided, plus the Natcen reports available on-line for 2009 to 2016, plus the version of the spss mother file with no cases.  Thanks to Jon Peck for that brilliantly effective solution to the data safeguarding problem, but I'm also quite chuffed about testing successfully, despite churlish appreciation from (? Fellow insomniac and beer freak?) DM:
SAVE OUT "<pathway>\<targetfile>.sav"
    /KEEP year ALL
If you are a Laurel and Hardy fan, you might also like:
https://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/bsas_2016_on_the_trail_of_the_lonesome_nine_s_.pdf
Happy weekend everyone

John F Hall  MA (Cantab) Dip Ed (Dunelm)
[Retired academic survey researcher]

Email:          [hidden email]
Website:     Journeys in Survey Research
Course:       Survey Analysis Workshop (SPSS)
Research:   Subjective Social Indicators (Quality of Life)

-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of David Marso
Sent: 28 September 2018 13:02
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file order

Yep. A very obvious solution for anyone who has barely browsed the FM. Congrats.

=====================
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

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Reorder vars with one variable first, then all others in file order

Bruce Weaver
Administrator
In reply to this post by John F Hall
From the FM entry for SAVE > DROP and KEEP Subcommands:

--- start of excerpt ---
DROP and KEEP are used to save a subset of variables. DROP specifies the
variables that are not to be saved in the new data file; KEEP specifies the
variables that are to be saved in the new data file; variables that are not
named on KEEP are dropped.

- Variables can be specified in any order. The order of variables on KEEP
determines the order of variables in the data file. The order on DROP does
not affect the order of variables in the data file.

- Keyword ALL on KEEP refers to all remaining variables that were not
previously specified on KEEP or DROP. ALL must be the last specification on
KEEP.

--- end of excerpt ---

I believe that last bullet point covers it.  ;-)

Source:
https://www.ibm.com/support/knowledgecenter/en/SSLVMB_25.0.0/statistics_reference_project_ddita/spss/base/syn_save_drop_keep.html

HTH.


John F Hall wrote

> Rick
>
> The point is that you can put one or more variables before ALL.  This is
> not in the FM.  At least BNzenia understands..
>
> John
>
> --- snip ---
>
> From: SPSSX(r) Discussion &lt;

> SPSSX-L@.UGA

> &gt; On Behalf Of Rick Oliver
> Sent: 28 September 2018 20:18
> To:

> SPSSX-L@.UGA

> Subject: Re: Reorder vars with one variable first, then all others in file
> order
>
>  
>
> The ability to reorder a subset of variables to the front of the variable
> order with KEEP VARLIST ALL had been around a long time, and it is
> available on multiple commands, including GET, SAVE, ADD FILES, and MATCH
> FILES.





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Reorder vars with one variable first, then all others in file order

David Marso
Administrator
In reply to this post by John F Hall
Reread that part of the FM mate.



-----
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Reorder vars with one variable first, then all others in file order

John F Hall
In reply to this post by Bruce Weaver
Humble pie from me.  I was working under pressure and didn't read far enough
down the page(s).  At least I got there by myself first time without relying
on the FM.  Must be a programmer deep down inside.

"A general data-processing package" (Hall J F 1968) describes an Algol
program I developed from 1965 to 1968 on the English Electric KDF9 computer
at the Royal College of Advanced Technology, Salford (now  University) input
and output on 8-hole paper tape.  
See:
https://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/hall_1968__a_gener
al_data-processing_package_.pdf. It was later modified to run on an English
Electric PDP11 at Birmingham University and was maintained as the Salford
Survey Suite until 1979 when, in view of the rapid spread and wide
availablity of SPSS in the UK, for which, through my advisory, computing and
teaching roles at the SSRC Survey Unit and later from my Survey Research
Unit at the Polytechnic of North London (now part of London Metropolitan
University) I was partly responsible, I advised it be discontinued.  

The Algol experience certainly helps to follow the logic of JKP's Python,
but not to write any myself.
John F Hall  MA (Cantab) Dip Ed (Dunelm)
[Retired academic survey researcher]

Email:          [hidden email]
Website:     Journeys in Survey Research
Course:       Survey Analysis Workshop (SPSS)
Research:   Subjective Social Indicators (Quality of Life)

-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Bruce
Weaver
Sent: 28 September 2018 21:07
To: [hidden email]
Subject: Re: Reorder vars with one variable first, then all others in file
order

From the FM entry for SAVE > DROP and KEEP Subcommands:

--- start of excerpt ---
DROP and KEEP are used to save a subset of variables. DROP specifies the
variables that are not to be saved in the new data file; KEEP specifies the
variables that are to be saved in the new data file; variables that are not
named on KEEP are dropped.

- Variables can be specified in any order. The order of variables on KEEP
determines the order of variables in the data file. The order on DROP does
not affect the order of variables in the data file.

- Keyword ALL on KEEP refers to all remaining variables that were not
previously specified on KEEP or DROP. ALL must be the last specification on
KEEP.

--- end of excerpt ---

I believe that last bullet point covers it.  ;-)

Source:
https://www.ibm.com/support/knowledgecenter/en/SSLVMB_25.0.0/statistics_refe
rence_project_ddita/spss/base/syn_save_drop_keep.html

HTH.


John F Hall wrote

> Rick
>
> The point is that you can put one or more variables before ALL.  This
> is not in the FM.  At least BNzenia understands..
>
> John
>
> --- snip ---
>
> From: SPSSX(r) Discussion &lt;

> SPSSX-L@.UGA

> &gt; On Behalf Of Rick Oliver
> Sent: 28 September 2018 20:18
> To:

> SPSSX-L@.UGA

> Subject: Re: Reorder vars with one variable first, then all others in
> file order
>
>  
>
> The ability to reorder a subset of variables to the front of the
> variable order with KEEP VARLIST ALL had been around a long time, and
> it is available on multiple commands, including GET, SAVE, ADD FILES,
> and MATCH FILES.





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Reorder vars with one variable first, then all others in file order

Bruce Weaver
Administrator
No worries, John.  Most of us know what humble pie tastes like.  I know I do!
;-)


John F Hall wrote
> Humble pie from me.  I was working under pressure and didn't read far
> enough
> down the page(s).  At least I got there by myself first time without
> relying
> on the FM.  Must be a programmer deep down inside.
>
> --- snip ---





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Reorder vars with one variable first, then all others in file order

David Marso-2
In reply to this post by John F Hall
Hear hear WORD!

=====================
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