pspp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Noob needs help with simple script


From: David Spaugh
Subject: Re: Noob needs help with simple script
Date: Wed, 11 May 2011 08:44:00 -0700

Nino - thanks!

I will modify my effort for the zero starting point.

Also - I looked to see if my script placed any data into the empty root sheet, but nothing was there, and PSPP locked up after about 15 seconds.

With your suggestions and Ben's help, I'll bet I'm on the right track soon.

Thanks!

DS

----- Original Message ----- From: "Rode, Nino" <address@hidden>
To: "David Spaugh" <address@hidden>
Sent: Wednesday, May 11, 2011 3:16 AM
Subject: RE: Noob needs help with simple script


Hello,

I'm a noobie in PSPP too, but with quite some experience with the other one.

I tried your example and for me on Ubuntu Linux (funny, also 0.7.5; I thought at launchpad there would be more recent versions) things work. There is an interesting glitch: the GET command begins reading the data with 0, not with 1, which we would expect... So you should write /VARIABLES=VMONTH 0-1 F (instead of 1-2) to get the numbers right. Is that written in the manual? Sa I rercall SPSS begins with 1 and we all seem to expect it. Back to your problem. Maybe PSPP did what you wanted but you didn't see it. Did you try to SAVE or LIST the data? A simple LIST command should show you if the PSPP has anything read in the data.
________________________________________
Od: address@hidden address@hidden v imenu David Spaugh address@hidden
Poslano: 11. maj 2011 7:09
Za: address@hidden
Zadeva: Noob needs help with simple script

Greetings,

PSPP version 0.7.5 running on Windows XP.

I wish to import a usgov NAMCS public data file into PSPP.

The data file is a single column of data with many rows. Each row is a record; each record has multiple fields containing data.

There are no delimiters or separators in the records; just a string of characters.

There is however a record format that defines the list of data items and the field length and field location of each.

Example: the 1st 2 characters of the record are the month field, the next 4 characters are the year field, the next 1 is the day field, etc.

I read the manual and have attempted to use the Get Data command. When I run it, I get some processor activity, then nothing. The application drops into the "Not responding" mode according to Windows.

Here's a sample of my Script:

GET DATA /TYPE=TXT /FILE='C:\Documents and Settings\Owner\My Documents\WPI New\Papers\Research Data\NAMCS\2008 raw data\NAMCS08' /ARRANGEMENT=FIXED /FIRSTCASE=1
/VARIABLES=VMONTH 1-2 F
 VYEAR 3-6 F
 VDAYR 7-7 F
 AGE 8-10 F
 SEX 11-11 A
 ETHNIC 12-13 A
 RACE 14-15 A.
********************
*SAVE /OUTFILE 'C:\Documents and Settings\Owner\Desktop\NAMCS08Tue'.
********************

I buried the Save command in asterisks to eliminate possible problems and focus on getting the file imported. There are 25,000 rows in the file. There are ~200 data elements within each record. My actual script encompasses all fields, but I truncated it here for brevity.

My objectives:
Import data. Save as a new file. Then do some basic sorting and rudimentary number crunching.

If you can help me get this data file into PSPP, I'd be very grateful. I have no idea why this isn't working. I'm a complete amateur at scripts.

I've eliminated all syntax errors, but the script still doesn't work. I don't know if I'm missing required elements, or trying to open something that PSPP cannot open, or what.

Thanks.

DS



reply via email to

[Prev in Thread] Current Thread [Next in Thread]