Trouble with DATA LIST

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

Trouble with DATA LIST

John F Hall
I can't replicate an exercise from John MacInnes' new book.  I've got as far as downloading an extract from the GSS and extracting the *.sps and *.dat files.

The downloaded DATA LIST command is:
DATA LIST FILE=TEMP  / FIXED RECORDS=1 TABLE /

TEMP has to be replaced by the file path name of the *.dat file
'C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss.dat'

DATA LIST FILE='C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss.dat'

I've tried various permutations, but keep getting "The DATA LIST command contains an invalid format"


It works for MacInnes, but not for me.  What am I missing?


John F Hall





 

===================== 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: Trouble with DATA LIST

Maguin, Eugene

Is that the complete text of the error message? I read the error message to mean that the variable+variable format list has an error in it. I’m assuming that the variable+format section is either x1 1-3 x2(a) 5-6 or x1 x2 (f3.0,1x,a2). Perhaps you had to re-type the variable+format section; could there be an unnoticed typing error? Doesn’t the error message say where the format problem is?  

Gene Maguin

 

 

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Wednesday, August 2, 2017 1:00 AM
To: [hidden email]
Subject: Trouble with DATA LIST

 

I can't replicate an exercise from John MacInnes' new book.  I've got as far as downloading an extract from the GSS and extracting the *.sps and *.dat files.

 

The downloaded DATA LIST command is:

DATA LIST FILE=TEMP  / FIXED RECORDS=1 TABLE /

 

TEMP has to be replaced by the file path name of the *.dat file

'C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss.dat'

 

DATA LIST FILE='C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss.dat'

I've tried various permutations, but keep getting "The DATA LIST command contains an invalid format"

 

It works for MacInnes, but not for me.  What am I missing?

 

John F Hall

 

 

 

 

 

===================== 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: Trouble with DATA LIST

Rick Oliver
In reply to this post by John F Hall
That is not complete data list command, but you can start by removing the forward slash before FIXED. You can also delete FIXED, since that is the default.

On Aug 2, 2017 12:09 AM, "John F Hall" <[hidden email]> wrote:
I can't replicate an exercise from John MacInnes' new book.  I've got as far as downloading an extract from the GSS and extracting the *.sps and *.dat files.

The downloaded DATA LIST command is:
DATA LIST FILE=TEMP  / FIXED RECORDS=1 TABLE /

TEMP has to be replaced by the file path name of the *.dat file
'C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss.dat'

DATA LIST FILE='C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss.dat'

I've tried various permutations, but keep getting "The DATA LIST command contains an invalid format"


It works for MacInnes, but not for me.  What am I missing?


John F Hall





 

===================== 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: Trouble with DATA LIST

Rick Oliver
In reply to this post by Maguin, Eugene

*this works.

data list fixed /x (f2) y (f2).

begin data

1 2

3 4

end data.

 

*this also works.

data list  /x (f2) y (f2).

begin data

1 2

3 4

end data.

 

*the forward slash before fixed causes the error.

data list /fixed /x (f2) y (f2).

begin data

1 2

3 4

end data.

 

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Wednesday, August 2, 2017 8:10 AM
To: [hidden email]
Subject: Re: Trouble with DATA LIST

 

Is that the complete text of the error message? I read the error message to mean that the variable+variable format list has an error in it. I’m assuming that the variable+format section is either x1 1-3 x2(a) 5-6 or x1 x2 (f3.0,1x,a2). Perhaps you had to re-type the variable+format section; could there be an unnoticed typing error? Doesn’t the error message say where the format problem is?  

Gene Maguin

 

 

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Wednesday, August 2, 2017 1:00 AM
To: [hidden email]
Subject: Trouble with DATA LIST

 

I can't replicate an exercise from John MacInnes' new book.  I've got as far as downloading an extract from the GSS and extracting the *.sps and *.dat files.

 

The downloaded DATA LIST command is:

DATA LIST FILE=TEMP  / FIXED RECORDS=1 TABLE /

 

TEMP has to be replaced by the file path name of the *.dat file

'C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss.dat'

 

DATA LIST FILE='C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss.dat'

I've tried various permutations, but keep getting "The DATA LIST command contains an invalid format"

 

It works for MacInnes, but not for me.  What am I missing?

 

John F Hall

 

 

 

 

 

===================== 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: Trouble with DATA LIST

John F Hall
In reply to this post by John F Hall

Diana, Mario, Gene, Rick, 

 

The data download was a selection of variables from the NORC General Social Survey using their shopping basket facility.  I was attempting to replicate an exercise from chapter 5 of John MacInnes An Introduction to Secondary Analysis with IBM-SPSS Statistics (Sage 2017).  Despite my best efforts over almost two days I got absolutely nowhere.

 

The *.sps file does have a dot (on its own line). In gss.sps from NORC the DATA LIST command reads:

 

DATA LIST FILE=TEMP FIXED RECORDS=1 TABLE /

   YEAR     1 - 20

   ID_      21 - 40

   MARITAL  41 - 60

   AGE      61 - 80

   EDUC     81 - 100

   SEX      101 - 120

   WRKBABY  121 - 140

   BALLOT   141 - 160

   WTSS     161 - 180

 

.

 

 My copy of file GSS.DAT  reads (1st 2 cases):

 

                1972                   1                   5                  23                  16                   2                   0                   0                 1.0
                1972                   2                   1                  70                  10                   1                   0                   0                 1.0

 

and the path (from Properties) is: C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

 

I replaced TEMP with:  "C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

 
DATA LIST  FILE="C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT"
  FIXED RECORDS=1 TABLE / blah blah 

 

. . and got:

 

>Error # 34 in column 17.  Text: C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT 

>SPSS Statistics cannot access a file with the given file specification.  The 

>file specification is either syntactically invalid, specifies an invalid 

>drive, specifies a protected directory, specifies a protected file, or 

>specifies a non-sharable file. 

 

>Execution of this command stops.

 

>Warning # 206 in column 20.  Text: \ 

>An invalid character has been found on a command. 

 

>Warning # 206 in column 26.  Text: \ 

>An invalid character has been found on a command. 

 

>Warning # 206 in column 36.  Text: \ 

>An invalid character has been found on a command. 

 

>Warning # 206 in column 44.  Text: \ 

>An invalid character has been found on a command. 

 

>Warning # 206 in column 58.  Text: \ 

>An invalid character has been found on a command. 

 

>Warning # 206 in column 68.  Text: \ 

 

>An invalid character has been found on a command.

 

If I change the double quotes to single:

 

 DATA LIST  FILE= 'C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT'

  FIXED RECORDS=1 TABLE /

 

I get exactly the same error.

 

As a last resort I copied the data into a Notepad file and used Ctrl+H to replace strings of 10 spaces with none.

 

1st 3 lines:

 

      1972         1         5        23        16         2         0         0       1.0

      1972         2         1        70        10         1         0         0       1.0

      1972         3         1        48        12         2         0         0       1.0

 

 

Last 3 lines:

 

      2016      2865         1        87        14         2         0         2   0.956993511490439

      2016      2866         1        55        14         2         0         1   0.956993511490439

      2016      2867         1        72        16         1         0         3   0.956993511490439

 

 

The decimal point in [WTSSALL] "Weight" varies in its column posiomn, but I risked the following syntax:

 

DATA LIST   file 'C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss3.txt'

 fixed

   /YEAR     7-10

   ID_      11-20

   MARITAL  21 - 30

   AGE      31 - 40

   EDUC     41 - 50

   SEX      51 - 60

   WRKBABY  61 - 70

   BALLOT   71 - 81 

   WTSSALL 81 - 100  .

 

It works!  No need for SOS to Jon K Peck or NORC !

 

I'd still like to know why I couldn't read the data from the original GSS.DAT file from NORC.  Is it perhaps GSS.DAT.TXT ?  I think we should be told.

 

John F Hall

[Retired academic survey researcher]

 

IBM-SPSS Academic author 9900074

 

Email:        johnfhall@... 

Website:   http://surveyresearch.weebly.com/

Course:     http://surveyresearch.weebly.com/1-survey-analysis-workshop-spss.html

Research: http://surveyresearch.weebly.com/3-subjective-social-indicators-quality-of-life.html

===================== 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: Trouble with DATA LIST

Maguin, Eugene

I stepped in a puddle yesterday and Rick corrected my error(s). I’m going to try again. The data list statement looks correct and it looks correct compared to the CSR.

I want to focus on this

1. and the path (from Properties) is: C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

2. I replaced TEMP with:  "C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

I read line 1 to say that the file name is ‘GSS files’ and that there is no ‘.dat’ extension (unless that extension is hidden by default. Is it?) nor any other extension either.

I read line 2 to say that the file name is ‘GSS.DAT’.

 

Am I wrong?

 

Gene Maguin

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Thursday, August 3, 2017 11:03 AM
To: [hidden email]
Subject: Re: Trouble with DATA LIST

 

Diana, Mario, Gene, Rick, 

 

The data download was a selection of variables from the NORC General Social Survey using their shopping basket facility.  I was attempting to replicate an exercise from chapter 5 of John MacInnes An Introduction to Secondary Analysis with IBM-SPSS Statistics (Sage 2017).  Despite my best efforts over almost two days I got absolutely nowhere.

 

The *.sps file does have a dot (on its own line). In gss.sps from NORC the DATA LIST command reads:

 

DATA LIST FILE=TEMP FIXED RECORDS=1 TABLE /

   YEAR     1 - 20

   ID_      21 - 40

   MARITAL  41 - 60

   AGE      61 - 80

   EDUC     81 - 100

   SEX      101 - 120

   WRKBABY  121 - 140

   BALLOT   141 - 160

   WTSS     161 - 180

 

.

 

 My copy of file GSS.DAT  reads (1st 2 cases):

 

                1972                   1                   5                  23                  16                   2                   0                   0                 1.0
                1972                   2                   1                  70                  10                   1                   0                   0                 1.0

 

and the path (from Properties) is: C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

 

I replaced TEMP with:  "C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

 

DATA LIST  FILE="C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT"

  FIXED RECORDS=1 TABLE / blah blah 

 

. . and got:

 

>Error # 34 in column 17.  Text: C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT 

>SPSS Statistics cannot access a file with the given file specification.  The 

>file specification is either syntactically invalid, specifies an invalid 

>drive, specifies a protected directory, specifies a protected file, or 

>specifies a non-sharable file. 

 

>Execution of this command stops.

 

>Warning # 206 in column 20.  Text: \ 

>An invalid character has been found on a command. 

 

>Warning # 206 in column 26.  Text: \ 

>An invalid character has been found on a command. 

 

>Warning # 206 in column 36.  Text: \ 

>An invalid character has been found on a command. 

 

>Warning # 206 in column 44.  Text: \ 

>An invalid character has been found on a command. 

 

>Warning # 206 in column 58.  Text: \ 

>An invalid character has been found on a command. 

 

>Warning # 206 in column 68.  Text: \ 

 

>An invalid character has been found on a command.

 

If I change the double quotes to single:

 

 DATA LIST  FILE= 'C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT'

  FIXED RECORDS=1 TABLE /

 

I get exactly the same error.

 

As a last resort I copied the data into a Notepad file and used Ctrl+H to replace strings of 10 spaces with none.

 

1st 3 lines:

 

      1972         1         5        23        16         2         0         0       1.0

      1972         2         1        70        10         1         0         0       1.0

      1972         3         1        48        12         2         0         0       1.0

 

 

Last 3 lines:

 

      2016      2865         1        87        14         2         0         2   0.956993511490439

      2016      2866         1        55        14         2         0         1   0.956993511490439

      2016      2867         1        72        16         1         0         3   0.956993511490439

 

 

The decimal point in [WTSSALL] "Weight" varies in its column posiomn, but I risked the following syntax:

 

DATA LIST   file 'C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss3.txt'

 fixed

   /YEAR     7-10

   ID_      11-20

   MARITAL  21 - 30

   AGE      31 - 40

   EDUC     41 - 50

   SEX      51 - 60

   WRKBABY  61 - 70

   BALLOT   71 - 81 

   WTSSALL 81 - 100  .

 

It works!  No need for SOS to Jon K Peck or NORC !

 

I'd still like to know why I couldn't read the data from the original GSS.DAT file from NORC.  Is it perhaps GSS.DAT.TXT ?  I think we should be told.

 

John F Hall

[Retired academic survey researcher]

 

IBM-SPSS Academic author 9900074

 

Email:        johnfhall@... 

Website:   http://surveyresearch.weebly.com/

Course:     http://surveyresearch.weebly.com/1-survey-analysis-workshop-spss.html

Research: http://surveyresearch.weebly.com/3-subjective-social-indicators-quality-of-life.html

===================== 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: Trouble with DATA LIST

John F Hall

To clarify.  

GSS files is a folder to which the path is:

C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

GSS.DAT is a file in that folder

 

I eventually traced the problem to using only a single space in MacInnes 2017: there should have been two, MacInnes  2017.  Such an easy mistake to make, but so difficult to spot.

 

The corrected syntax works with the data file as downloaded from NORC.

 

DATA LIST  FILE="C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

  FIXED RECORDS=1 TABLE /

blah blah 

 

My workaround using Notepad at least made it easier to inspect the data.  Variable WTSSALL appeared in my *.sav file with 0 Decimals, but changing it manually to 15 in the Data Editor displays the correct values.  Yes, weights really are calculated to 15 decimals.

 

Back to the GSS exercises in chapter 5.

 

 

(Mr) John F Hall

[Retired academic survey researcher]

 

Email:         johnfhall@...

Website:    Journeys in Survey Research

Course:      Survey Analysis Workshop (SPSS) 

Research:  Subjective Social Indicators (Quality of Life)

 

 

 

 

 

 

> Message du 03/08/17 19:47

> De : "Maguin, Eugene" <[hidden email]>
> A : [hidden email]
> Copie à :
> Objet : Re: Trouble with DATA LIST
>
>

I stepped in a puddle yesterday and Rick corrected my error(s). I’m going to try again. The data list statement looks correct and it looks correct compared to the CSR.

I want to focus on this

> 1. and the path (from Properties) is: C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

> 2. I replaced TEMP with:  "C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

I read line 1 to say that the file name is ‘GSS files’ and that there is no ‘.dat’ extension (unless that extension is hidden by default. Is it?) nor any other extension either.

I read line 2 to say that the file name is ‘GSS.DAT’.

 

Am I wrong?

 

Gene Maguin

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
> Sent: Thursday, August 3, 2017 11:03 AM
> To: [hidden email]
> Subject: Re: Trouble with DATA LIST

 

> Diana, Mario, Gene, Rick, 

>  

> The data download was a selection of variables from the NORC General Social Survey using their shopping basket facility.  I was attempting to replicate an exercise from chapter 5 of John MacInnes An Introduction to Secondary Analysis with IBM-SPSS Statistics (Sage 2017).  Despite my best efforts over almost two days I got absolutely nowhere.

>  

> The *.sps file does have a dot (on its own line). In gss.sps from NORC the DATA LIST command reads:

>  

> DATA LIST FILE=TEMP FIXED RECORDS=1 TABLE /

>    YEAR     1 - 20

>    ID_      21 - 40

>    MARITAL  41 - 60

>    AGE      61 - 80

>    EDUC     81 - 100

>    SEX      101 - 120

>    WRKBABY  121 - 140

>    BALLOT   141 - 160

>    WTSS     161 - 180

>  

> .

>  

>  My copy of file GSS.DAT  reads (1st 2 cases):

>  

                1972                   1                   5                  23                  16                   2                   0                   0                 1.0
>                 1972                   2                   1                  70                  10                   1                   0                   0                 1.0

>  

> and the path (from Properties) is: C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

>  

> I replaced TEMP with:  "C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

 

DATA LIST  FILE="C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT"

  FIXED RECORDS=1 TABLE / blah blah 

>  

> . . and got:

>  

> >Error # 34 in column 17.  Text: C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT 

> >SPSS Statistics cannot access a file with the given file specification.  The 

> >file specification is either syntactically invalid, specifies an invalid 

> >drive, specifies a protected directory, specifies a protected file, or 

> >specifies a non-sharable file. 

>  

> >Execution of this command stops.

>  

> >Warning # 206 in column 20.  Text: \ 

> >An invalid character has been found on a command. 

>  

> >Warning # 206 in column 26.  Text: \ 

> >An invalid character has been found on a command. 

>  

> >Warning # 206 in column 36.  Text: \ 

> >An invalid character has been found on a command. 

>  

> >Warning # 206 in column 44.  Text: \ 

> >An invalid character has been found on a command. 

>  

> >Warning # 206 in column 58.  Text: \ 

> >An invalid character has been found on a command. 

>  

> >Warning # 206 in column 68.  Text: \ 

>  

> >An invalid character has been found on a command.

>  

> If I change the double quotes to single:

>  

>  DATA LIST  FILE= 'C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT'

>   FIXED RECORDS=1 TABLE /

>  

> I get exactly the same error.

>  

> As a last resort I copied the data into a Notepad file and used Ctrl+H to replace strings of 10 spaces with none.

>  

> 1st 3 lines:

>  

>       1972         1         5        23        16         2         0         0       1.0

>       1972         2         1        70        10         1         0         0       1.0

>       1972         3         1        48        12         2         0         0       1.0

 

>  

> Last 3 lines:

>  

>       2016      2865         1        87        14         2         0         2   0.956993511490439

>       2016      2866         1        55        14         2         0         1   0.956993511490439

>       2016      2867         1        72        16         1         0         3   0.956993511490439

 

>  

> The decimal point in [WTSSALL] "Weight" varies in its column posiomn, but I risked the following syntax:

>  

> DATA LIST   file 'C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss3.txt'

>  fixed

>    /YEAR     7-10

>    ID_      11-20

>    MARITAL  21 - 30

>    AGE      31 - 40

>    EDUC     41 - 50

>    SEX      51 - 60

>    WRKBABY  61 - 70

>    BALLOT   71 - 81 

>    WTSSALL 81 - 100  .

>  

> It works!  No need for SOS to Jon K Peck or NORC !

>  

> I'd still like to know why I couldn't read the data from the original GSS.DAT file from NORC.  Is it perhaps GSS.DAT.TXT ?  I think we should be told.

>  

John F Hall

[Retired academic survey researcher]

 

IBM-SPSS Academic author 9900074

 

Email:        johnfhall@... 

Website:   http://surveyresearch.weebly.com/

Course:     http://surveyresearch.weebly.com/1-survey-analysis-workshop-spss.html

Research: http://surveyresearch.weebly.com/3-subjective-social-indicators-quality-of-life.html

===================== 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: Trouble with DATA LIST

Rick Oliver
I have never used spaces in file/folder names for a variety of reasons. I'll add this one to the list.

Virus-free. www.avg.com

On Fri, Aug 4, 2017 at 4:43 AM, John F Hall <[hidden email]> wrote:

To clarify.  

GSS files is a folder to which the path is:

C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

GSS.DAT is a file in that folder

 

I eventually traced the problem to using only a single space in MacInnes 2017: there should have been two, MacInnes  2017.  Such an easy mistake to make, but so difficult to spot.

 

The corrected syntax works with the data file as downloaded from NORC.

 

DATA LIST  FILE="C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

  FIXED RECORDS=1 TABLE /

blah blah 

 

My workaround using Notepad at least made it easier to inspect the data.  Variable WTSSALL appeared in my *.sav file with 0 Decimals, but changing it manually to 15 in the Data Editor displays the correct values.  Yes, weights really are calculated to 15 decimals.

 

Back to the GSS exercises in chapter 5.

 

 

(Mr) John F Hall

[Retired academic survey researcher]

 

Email:         johnfhall@...

Website:    Journeys in Survey Research

Course:      Survey Analysis Workshop (SPSS) 

Research:  Subjective Social Indicators (Quality of Life)

 

 

 

 

 

 

> Message du 03/08/17 19:47

> De : "Maguin, Eugene" <[hidden email]>
> A : [hidden email]
> Copie à :
> Objet : Re: Trouble with DATA LIST
>
>

I stepped in a puddle yesterday and Rick corrected my error(s). I’m going to try again. The data list statement looks correct and it looks correct compared to the CSR.

I want to focus on this

> 1. and the path (from Properties) is: C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

> 2. I replaced TEMP with:  "C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

I read line 1 to say that the file name is ‘GSS files’ and that there is no ‘.dat’ extension (unless that extension is hidden by default. Is it?) nor any other extension either.

I read line 2 to say that the file name is ‘GSS.DAT’.

 

Am I wrong?

 

Gene Maguin

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
> Sent: Thursday, August 3, 2017 11:03 AM
> To: [hidden email]
> Subject: Re: Trouble with DATA LIST

 

> Diana, Mario, Gene, Rick, 

>  

> The data download was a selection of variables from the NORC General Social Survey using their shopping basket facility.  I was attempting to replicate an exercise from chapter 5 of John MacInnes An Introduction to Secondary Analysis with IBM-SPSS Statistics (Sage 2017).  Despite my best efforts over almost two days I got absolutely nowhere.

>  

> The *.sps file does have a dot (on its own line). In gss.sps from NORC the DATA LIST command reads:

>  

> DATA LIST FILE=TEMP FIXED RECORDS=1 TABLE /

>    YEAR     1 - 20

>    ID_      21 - 40

>    MARITAL  41 - 60

>    AGE      61 - 80

>    EDUC     81 - 100

>    SEX      101 - 120

>    WRKBABY  121 - 140

>    BALLOT   141 - 160

>    WTSS     161 - 180

>  

> .

>  

>  My copy of file GSS.DAT  reads (1st 2 cases):

>  

                1972                   1                   5                  23                  16                   2                   0                   0                 1.0
>                 1972                   2                   1                  70                  10                   1                   0                   0                 1.0

>  

> and the path (from Properties) is: C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

>  

> I replaced TEMP with:  "C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

 

DATA LIST  FILE="C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT"

  FIXED RECORDS=1 TABLE / blah blah 

>  

> . . and got:

>  

> >Error # 34 in column 17.  Text: C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT 

> >SPSS Statistics cannot access a file with the given file specification.  The 

> >file specification is either syntactically invalid, specifies an invalid 

> >drive, specifies a protected directory, specifies a protected file, or 

> >specifies a non-sharable file. 

>  

> >Execution of this command stops.

>  

> >Warning # 206 in column 20.  Text: \ 

> >An invalid character has been found on a command. 

>  

> >Warning # 206 in column 26.  Text: \ 

> >An invalid character has been found on a command. 

>  

> >Warning # 206 in column 36.  Text: \ 

> >An invalid character has been found on a command. 

>  

> >Warning # 206 in column 44.  Text: \ 

> >An invalid character has been found on a command. 

>  

> >Warning # 206 in column 58.  Text: \ 

> >An invalid character has been found on a command. 

>  

> >Warning # 206 in column 68.  Text: \ 

>  

> >An invalid character has been found on a command.

>  

> If I change the double quotes to single:

>  

>  DATA LIST  FILE= 'C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT'

>   FIXED RECORDS=1 TABLE /

>  

> I get exactly the same error.

>  

> As a last resort I copied the data into a Notepad file and used Ctrl+H to replace strings of 10 spaces with none.

>  

> 1st 3 lines:

>  

>       1972         1         5        23        16         2         0         0       1.0

>       1972         2         1        70        10         1         0         0       1.0

>       1972         3         1        48        12         2         0         0       1.0

 

>  

> Last 3 lines:

>  

>       2016      2865         1        87        14         2         0         2   0.956993511490439

>       2016      2866         1        55        14         2         0         1   0.956993511490439

>       2016      2867         1        72        16         1         0         3   0.956993511490439

 

>  

> The decimal point in [WTSSALL] "Weight" varies in its column posiomn, but I risked the following syntax:

>  

> DATA LIST   file 'C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss3.txt'

>  fixed

>    /YEAR     7-10

>    ID_      11-20

>    MARITAL  21 - 30

>    AGE      31 - 40

>    EDUC     41 - 50

>    SEX      51 - 60

>    WRKBABY  61 - 70

>    BALLOT   71 - 81 

>    WTSSALL 81 - 100  .

>  

> It works!  No need for SOS to Jon K Peck or NORC !

>  

> I'd still like to know why I couldn't read the data from the original GSS.DAT file from NORC.  Is it perhaps GSS.DAT.TXT ?  I think we should be told.

>  

John F Hall

[Retired academic survey researcher]

 

IBM-SPSS Academic author 9900074

 

Email:        johnfhall@... 

Website:   http://surveyresearch.weebly.com/

Course:     http://surveyresearch.weebly.com/1-survey-analysis-workshop-spss.html

Research: http://surveyresearch.weebly.com/3-subjective-social-indicators-quality-of-life.html

===================== 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: Trouble with DATA LIST

John F Hall

Rick

I need to do the same!

An earlier reply said the / before FILE could be the cause of the problem.  That was probably because MacInnes' (in my view cumbersome) method of finding the file path name from the Syntax Editor uses the SPSS Import wizard with:

File >> Import Data >> Text Data

which produces:

GET DATA  /TYPE=TXT

 

  /FILE="C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.dat"

. . which I think must have just copied (swallowed) whole.

I still think right click >> Properties is the most effective way to find and copy a path.

(Mr) John F Hall

[Retired academic survey researcher]

 

Email:         johnfhall@...

Website:    Journeys in Survey Research

Course:      Survey Analysis Workshop (SPSS) 

Research:  Subjective Social Indicators (Quality of Life)

 

 

 

 

 

 

> Message du 04/08/17 17:20

> De : "Rick Oliver" <[hidden email]>
> A : [hidden email]
> Copie à :
> Objet : Re: Trouble with DATA LIST
>
>
I have never used spaces in file/folder names for a variety of reasons. I'll add this one to the list.

>
Virus-free. www.avg.com

>
On Fri, Aug 4, 2017 at 4:43 AM, John F Hall <[hidden email]> wrote:
>

> To clarify.  

> GSS files is a folder to which the path is:

> C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

> GSS.DAT is a file in that folder

>  

> I eventually traced the problem to using only a single space in MacInnes 2017: there should have been two, MacInnes  2017.  Such an easy mistake to make, but so difficult to spot.

>  

> The corrected syntax works with the data file as downloaded from NORC.

>  

DATA LIST  FILE="C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

>   FIXED RECORDS=1 TABLE /

> blah blah 

>  

> My workaround using Notepad at least made it easier to inspect the data.  Variable WTSSALL appeared in my *.sav file with 0 Decimals, but changing it manually to 15 in the Data Editor displays the correct values.  Yes, weights really are calculated to 15 decimals.

>  

> Back to the GSS exercises in chapter 5.

>  

>  

(Mr) John F Hall

[Retired academic survey researcher]

 

Email:         johnfhall@...

Website:    Journeys in Survey Research

Course:      Survey Analysis Workshop (SPSS) 

Research:  Subjective Social Indicators (Quality of Life)

>  

>  

>  

>  

>  

>  

> Message du 03/08/17 19:47
> > De : "Maguin, Eugene" <[hidden email]>
> > A : [hidden email]
> > Copie à :
> > Objet : Re: Trouble with DATA LIST
> >
> >

I stepped in a puddle yesterday and Rick corrected my error(s). I’m going to try again. The data list statement looks correct and it looks correct compared to the CSR.

I want to focus on this

> > 1. and the path (from Properties) is: C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

> > 2. I replaced TEMP with:  "C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

I read line 1 to say that the file name is ‘GSS files’ and that there is no ‘.dat’ extension (unless that extension is hidden by default. Is it?) nor any other extension either.

I read line 2 to say that the file name is ‘GSS.DAT’.

 

Am I wrong?

 

Gene Maguin

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
> > Sent: Thursday, August 3, 2017 11:03 AM
> > To: [hidden email]
> > Subject: Re: Trouble with DATA LIST

 

> > Diana, Mario, Gene, Rick, 

> >  

> > The data download was a selection of variables from the NORC General Social Survey using their shopping basket facility.  I was attempting to replicate an exercise from chapter 5 of John MacInnes An Introduction to Secondary Analysis with IBM-SPSS Statistics (Sage 2017).  Despite my best efforts over almost two days I got absolutely nowhere.

> >  

> > The *.sps file does have a dot (on its own line). In gss.sps from NORC the DATA LIST command reads:

> >  

> > DATA LIST FILE=TEMP FIXED RECORDS=1 TABLE /

> >    YEAR     1 - 20

> >    ID_      21 - 40

> >    MARITAL  41 - 60

> >    AGE      61 - 80

> >    EDUC     81 - 100

> >    SEX      101 - 120

> >    WRKBABY  121 - 140

> >    BALLOT   141 - 160

> >    WTSS     161 - 180

> >  

> > .

> >  

> >  My copy of file GSS.DAT  reads (1st 2 cases):

> >  

                1972                   1                   5                  23                  16                   2                   0                   0                 1.0
> >                 1972                   2                   1                  70                  10                   1                   0                   0                 1.0

> >  

> > and the path (from Properties) is: C:\Users\John Hall\Desktop\MacInnes  2017\GSS files

> >  

> > I replaced TEMP with:  "C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\GSS.DAT"

 

DATA LIST  FILE="C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT"

  FIXED RECORDS=1 TABLE / blah blah 

> >  

> > . . and got:

> >  

> > >Error # 34 in column 17.  Text: C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT 

> > >SPSS Statistics cannot access a file with the given file specification.  The 

> > >file specification is either syntactically invalid, specifies an invalid 

> > >drive, specifies a protected directory, specifies a protected file, or 

> > >specifies a non-sharable file. 

> >  

> > >Execution of this command stops.

> >  

> > >Warning # 206 in column 20.  Text: \ 

> > >An invalid character has been found on a command. 

> >  

> > >Warning # 206 in column 26.  Text: \ 

> > >An invalid character has been found on a command. 

> >  

> > >Warning # 206 in column 36.  Text: \ 

> > >An invalid character has been found on a command. 

> >  

> > >Warning # 206 in column 44.  Text: \ 

> > >An invalid character has been found on a command. 

> >  

> > >Warning # 206 in column 58.  Text: \ 

> > >An invalid character has been found on a command. 

> >  

> > >Warning # 206 in column 68.  Text: \ 

> >  

> > >An invalid character has been found on a command.

> >  

> > If I change the double quotes to single:

> >  

> >  DATA LIST  FILE= 'C:\Users\John Hall\Desktop\MacInnes 2017\GSS files\GSS.DAT'

> >   FIXED RECORDS=1 TABLE /

> >  

> > I get exactly the same error.

> >  

> > As a last resort I copied the data into a Notepad file and used Ctrl+H to replace strings of 10 spaces with none.

> >  

> > 1st 3 lines:

> >  

> >       1972         1         5        23        16         2         0         0       1.0

> >       1972         2         1        70        10         1         0         0       1.0

> >       1972         3         1        48        12         2         0         0       1.0

 

> >  

> > Last 3 lines:

> >  

> >       2016      2865         1        87        14         2         0         2   0.956993511490439

> >       2016      2866         1        55        14         2         0         1   0.956993511490439

> >       2016      2867         1        72        16         1         0         3   0.956993511490439

 

> >  

> > The decimal point in [WTSSALL] "Weight" varies in its column posiomn, but I risked the following syntax:

> >  

> > DATA LIST   file 'C:\Users\John Hall\Desktop\MacInnes  2017\GSS files\gss3.txt'

> >  fixed

> >    /YEAR     7-10

> >    ID_      11-20

> >    MARITAL  21 - 30

> >    AGE      31 - 40

> >    EDUC     41 - 50

> >    SEX      51 - 60

> >    WRKBABY  61 - 70

> >    BALLOT   71 - 81 

> >    WTSSALL 81 - 100  .

> >  

> > It works!  No need for SOS to Jon K Peck or NORC !

> >  

> > I'd still like to know why I couldn't read the data from the original GSS.DAT file from NORC.  Is it perhaps GSS.DAT.TXT ?  I think we should be told.

> >  

John F Hall

[Retired academic survey researcher]

 

IBM-SPSS Academic author 9900074

 

Email:        johnfhall@... 

Website:   http://surveyresearch.weebly.com/

Course:     http://surveyresearch.weebly.com/1-survey-analysis-workshop-spss.html

Research: http://surveyresearch.weebly.com/3-subjective-social-indicators-quality-of-life.html

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