Re: Prepping Data from Web Application for SPSS Import

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

Re: Prepping Data from Web Application for SPSS Import

Owen Scott Medd
Sorry for the stupid newbie question, but it seems I have a very related
question so here goes...

I currently have a (perl) script that generates a data import file and a set
of spss commands to create an spss data set for in-house analysis.  In an
effort to reduce the turn-around time to get these files generated, I
thought I'd migrate the file generation to be done from a web application.
The simplest thing to do seemed to be to generate a single file with a "DATA
LIST LIST" command, the data itself, and then the various values
definitions, etc.

As a first pass, I modified my script to generate that single file and then
tried to run that as a script in SPSS (version 14) with mixed success.  I
should mention that the data list command I generated is:

DATA LIST LIST /
 VAR0 (F7) VAR1 (F4.2) VAR2 (A3591) VAR3 (A5) VAR4 (A7) VAR5 (A3).

VAR's names changed to protect the guilty.

Notice that VAR2 is a big long comment field.  If I import this using the
text import wizard in SPSS, everything is ducky.  However, any data input
line longer than about 252 characters is split into two, causing errors and
an incorrect load.

I *thought* I read that input lines could be 8K now.  Is this an issue with
having immediate data and I should abandon my dream of downloading a single
file to the users?

Any thoughts appreciated!

Thanks,
Owen
Reply | Threaded
Open this post in threaded view
|

Re: Prepping Data from Web Application for SPSS Import

Raynald Levesque
Hi

You should have no problems reading these records. By default, recent
versions of SPSS can read records of up to 8,192 bytes. To read longer
records (up to 2 billion characters) use the FILE HANDLE command. Look in
particular at the \LRECL subcommand.

Regards

Raynald Levesque [hidden email]
Visit my SPSS site: http://www.spsstools.net


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Owen Medd
Sent: October 11, 2006 2:07 PM
To: [hidden email]
Subject: Re: Prepping Data from Web Application for SPSS Import

Sorry for the stupid newbie question, but it seems I have a very related
question so here goes...

I currently have a (perl) script that generates a data import file and a set
of spss commands to create an spss data set for in-house analysis.  In an
effort to reduce the turn-around time to get these files generated, I
thought I'd migrate the file generation to be done from a web application.
The simplest thing to do seemed to be to generate a single file with a "DATA
LIST LIST" command, the data itself, and then the various values
definitions, etc.

As a first pass, I modified my script to generate that single file and then
tried to run that as a script in SPSS (version 14) with mixed success.  I
should mention that the data list command I generated is:

DATA LIST LIST /
 VAR0 (F7) VAR1 (F4.2) VAR2 (A3591) VAR3 (A5) VAR4 (A7) VAR5 (A3).

VAR's names changed to protect the guilty.

Notice that VAR2 is a big long comment field.  If I import this using the
text import wizard in SPSS, everything is ducky.  However, any data input
line longer than about 252 characters is split into two, causing errors and
an incorrect load.

I *thought* I read that input lines could be 8K now.  Is this an issue with
having immediate data and I should abandon my dream of downloading a single
file to the users?

Any thoughts appreciated!

Thanks,
Owen
Reply | Threaded
Open this post in threaded view
|

Re: Prepping Data from Web Application for SPSS Import

Owen Scott Medd
I have heard privately that the issue is because, since I want to deliver
one file, I am including the data in a BEGIN DATA-END DATA section and
there are input buffer limits on program files much lower than the buffer
limits on data files.

I think my only recourse is to generate a zip file that includes the
SPSS commands to construct the dataset in one file and the data in a
separate file.  The user could then (hopefully) double-click the
program (syntax?) file to load the data and get the dataset built.
Worst case is I'd have to add a third file that would be a DOS batch
file to run spss with the other two files (luckily I only have to
worry about Windows users for this).

Other than getting a Linux SPSS server version, are there any other options?
If there weren't labels and values involved, I could sneak by with
dumping out an Excel file, but that isn't an option.

Thanks to everyone who responded, I'm much better informed now.

Owen

On Wed, Oct 11, 2006 at 09:22:59PM -0400, Raynald Levesque wrote:

> Hi
>
> You should have no problems reading these records. By default, recent
> versions of SPSS can read records of up to 8,192 bytes. To read longer
> records (up to 2 billion characters) use the FILE HANDLE command. Look in
> particular at the \LRECL subcommand.
>
> Regards
>
> Raynald Levesque [hidden email]
> Visit my SPSS site: http://www.spsstools.net
>
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
> Owen Medd
> Sent: October 11, 2006 2:07 PM
> To: [hidden email]
> Subject: Re: Prepping Data from Web Application for SPSS Import
>
> Sorry for the stupid newbie question, but it seems I have a very related
> question so here goes...
>
> I currently have a (perl) script that generates a data import file and a set
> of spss commands to create an spss data set for in-house analysis.  In an
> effort to reduce the turn-around time to get these files generated, I
> thought I'd migrate the file generation to be done from a web application.
> The simplest thing to do seemed to be to generate a single file with a "DATA
> LIST LIST" command, the data itself, and then the various values
> definitions, etc.
>
> As a first pass, I modified my script to generate that single file and then
> tried to run that as a script in SPSS (version 14) with mixed success.  I
> should mention that the data list command I generated is:
>
> DATA LIST LIST /
>  VAR0 (F7) VAR1 (F4.2) VAR2 (A3591) VAR3 (A5) VAR4 (A7) VAR5 (A3).
>
> VAR's names changed to protect the guilty.
>
> Notice that VAR2 is a big long comment field.  If I import this using the
> text import wizard in SPSS, everything is ducky.  However, any data input
> line longer than about 252 characters is split into two, causing errors and
> an incorrect load.
>
> I *thought* I read that input lines could be 8K now.  Is this an issue with
> having immediate data and I should abandon my dream of downloading a single
> file to the users?
>
> Any thoughts appreciated!
>
> Thanks,
> Owen
>