reading a data

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

reading a data

s_pushparaj
A month back I sent a request for reading a data with a condition. I was advised to use the REREAD command.
Now I have some problem related to that
Earlier I used data list command like the one below to read the txt file.
data list file "D:\Nss60_10\ahq2.txt" records 1/1

irsch 1-3 (A)

fsuno 4-8 (A)

rnd 9-10 (A)

sh 11-13

sht 14-14

samp 15-15

sector 16-16

state 17-19 (A)

district 20-21

stratum 22-23

subrnd 24-24

subsamp 25-25

subrgn 26-29

subbkno 30-30

secst 31-31

hhno 32-33.

Then I found the Mixed data reading format more useful given in a data management in SPSS book. So I used the following command sequence

FILE TYPE MIXED RECORD = 34-35 (A).

- RECORD TYPE '01'.

- DATA LIST FIXED

/

irsch 1-3 (A)

fsuno 4-8 (A)

rnd 9-10 (A)

sh 11-13

sht 14-14

samp 15-15

sector 16-16

state 17-19 (A)

district 20-21

stratum 22-23

subrnd 24-24

subsamp 25-25

subrgn 26-29

subbkno 30-30

secst 31-31

hhno 32-33.

END FILE TYPE.

But I am not able to insert the file location to prompt the spss processor to read the file.

Kindly help

pushparaj
Reply | Threaded
Open this post in threaded view
|

Re: reading a data

Melissa Ives
According to SPSS help, the example is:

FILE TYPE  MIXED FILE='c:\data\treatmnt.txt' RECORD=RECID 1-2.

So you would need to add the "FILE='<path/filename>'" portion to your
syntax.

Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
s_pushparaj
Sent: Wednesday, August 29, 2007 9:43 AM
To: [hidden email]
Subject: [SPSSX-L] reading a data

A month back I sent a request for reading a data with a condition. I was
advised to use the REREAD command.
Now I have some problem related to that
Earlier I used data list command like the one below to read the txt
file.
data list file "D:\Nss60_10\ahq2.txt" records 1/1

irsch 1-3 (A)

fsuno 4-8 (A)

rnd 9-10 (A)

sh 11-13

sht 14-14

samp 15-15

sector 16-16

state 17-19 (A)

district 20-21

stratum 22-23

subrnd 24-24

subsamp 25-25

subrgn 26-29

subbkno 30-30

secst 31-31

hhno 32-33.

Then I found the Mixed data reading format more useful given in a data
management in SPSS book. So I used the following command sequence

FILE TYPE MIXED RECORD = 34-35 (A).

- RECORD TYPE '01'.

- DATA LIST FIXED

/

irsch 1-3 (A)

fsuno 4-8 (A)

rnd 9-10 (A)

sh 11-13

sht 14-14

samp 15-15

sector 16-16

state 17-19 (A)

district 20-21

stratum 22-23

subrnd 24-24

subsamp 25-25

subrgn 26-29

subbkno 30-30

secst 31-31

hhno 32-33.

END FILE TYPE.

But I am not able to insert the file location to prompt the spss
processor to read the file.

Kindly help

pushparaj


PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.
Reply | Threaded
Open this post in threaded view
|

Re: reading a data

Raynald Levesque-2
In reply to this post by s_pushparaj
The file name and path are inserted after the MIXED keyword:

FILE TYPE MIXED [FILE='file'] RECORD=[varname] column location [(format)]

Regards

--
Raynald Levesque
www.spsstools.net

On 8/29/07, s_pushparaj <[hidden email]> wrote:

>
> A month back I sent a request for reading a data with a condition. I was
> advised to use the REREAD command.
> Now I have some problem related to that
> Earlier I used data list command like the one below to read the txt file.
> data list file "D:\Nss60_10\ahq2.txt" records 1/1
>
> irsch 1-3 (A)
>
> fsuno 4-8 (A)
>
> rnd 9-10 (A)
>
> sh 11-13
>
> sht 14-14
>
> samp 15-15
>
> sector 16-16
>
> state 17-19 (A)
>
> district 20-21
>
> stratum 22-23
>
> subrnd 24-24
>
> subsamp 25-25
>
> subrgn 26-29
>
> subbkno 30-30
>
> secst 31-31
>
> hhno 32-33.
>
> Then I found the Mixed data reading format more useful given in a data
> management in SPSS book. So I used the following command sequence
>
> FILE TYPE MIXED RECORD = 34-35 (A).
>
> - RECORD TYPE '01'.
>
> - DATA LIST FIXED
>
> /
>
> irsch 1-3 (A)
>
> fsuno 4-8 (A)
>
> rnd 9-10 (A)
>
> sh 11-13
>
> sht 14-14
>
> samp 15-15
>
> sector 16-16
>
> state 17-19 (A)
>
> district 20-21
>
> stratum 22-23
>
> subrnd 24-24
>
> subsamp 25-25
>
> subrgn 26-29
>
> subbkno 30-30
>
> secst 31-31
>
> hhno 32-33.
>
> END FILE TYPE.
>
> But I am not able to insert the file location to prompt the spss processor
> to read the file.
>
> Kindly help
>
> pushparaj
>