get data /

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

get data /

drfg2008
SPSS 17 / Vista

Is it possible to directly get / open an spss datafile from an internet server via syntax? For example an spss file could be downloaded on www.this_is_the_domain.org/spss-file.sav

Can SPSS access such a file directly via syntax or python, without previously downloading it on my own c:// harddisk?

Frank
Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: get data /

Jon K Peck
You can use the extension command SPSSINC GETURI DATA available from the SPSS Community (www.ibm.com/developerworks/spssdevcentral).  It requires the Python plugin/Essentials.

This command will download the file and open it in SPSS Statistics.

Here is the beginning of the help (SPSSINC GETURI DATA /HELP).

spssinc geturi data/help.

SPSSINC GETURI DATA URI="uri including filename"
FILETYPE={SPSS* | XLS | SAS | STATA}
[DATASET = datasetname]
[/OPTIONS
-- options for Excel --
[ASSUMEDSTRWIDTH=number]
[SHEETNAME="sheet name"]
[SHEETNUMBER = number]
[CELLRANGE = "Excel range specification"]
[READNAMES={YES* | NO}]
-- options for SAS --
[DSET = "dataset name"]]
[/HELP]

Open an SPSS, Excel, SAS, or Stata dataset from a web url.

URI specifies the full web address including the protocol such as http:// or ftp://
FILETYPE specifies the type of file to read.

HTH,


Jon Peck
Senior Software Engineer, IBM
[hidden email]
312-651-3435




From:        drfg2008 <[hidden email]>
To:        [hidden email]
Date:        02/28/2011 03:20 AM
Subject:        [SPSSX-L] get data /
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




SPSS 17 / Vista

Is it possible to directly get / open an spss datafile from an internet
server via syntax? For example an spss file could be downloaded on
www.this_is_the_domain.org/spss-file.sav

Can SPSS access such a file directly via syntax or python, without
previously downloading it on my own c:// harddisk?

Frank


-----
FUB

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/get-data-tp3403038p3403038.html
Sent from the SPSSX Discussion mailing list archive at 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

Reply | Threaded
Open this post in threaded view
|

Re: get data /

drfg2008
SPSS 17 - Vista

I tried this, but obviously there must be a mistake in my syntax


BEGIN PROGRAM.
import spss,spssaux

SPSSINC GETURI DATA URI="http://spss-seminar.de/youtube-1.sav"
FILETYPE={SPSS}
[DATASET = File1]

END PROGRAM.

Results in:

 File "<string>", line 4
    SPSSINC GETURI DATA URI="http://spss-seminar.de/youtube-1.sav"
                 ^
SyntaxError: invalid syntax


Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: get data /

Jon K Peck
Extension commands are used like regular syntax.  Don't put them in a begin program block.

Just run
SPSSINC GETURI DATA URI="http://spss-seminar.de/youtube-1.sav".

The syntax is displayed in the standard SPSS notation (see the CSR for an explanation), so, for example, the bracket notation {} indicates that you choose one of the listed entries (and if one is marked with *, it is the default).



Jon Peck
Senior Software Engineer, IBM
[hidden email]
312-651-3435




From:        drfg2008 <[hidden email]>
To:        [hidden email]
Date:        02/28/2011 07:17 AM
Subject:        Re: [SPSSX-L] get data /
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




SPSS 17 - Vista

I tried this, but obviously there must be a mistake in my syntax


BEGIN PROGRAM.
import spss,spssaux

SPSSINC GETURI DATA URI="
http://spss-seminar.de/youtube-1.sav"
FILETYPE={SPSS}
[DATASET = File1]

END PROGRAM.

Results in:

File "<string>", line 4
   SPSSINC GETURI DATA URI="
http://spss-seminar.de/youtube-1.sav"
                ^
SyntaxError: invalid syntax




-----
FUB

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/get-data-tp3403038p3403320.html
Sent from the SPSSX Discussion mailing list archive at 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

Reply | Threaded
Open this post in threaded view
|

Re: get data /

drfg2008
thank you again,

I run exactly the following code:

BEGIN PROGRAM.
import spss,spssaux
SPSSINC GETURI DATA URI="http://spss-seminar.de/youtube-1.sav".
END PROGRAM.


but the result ist an error message. May it be possible, that with SPSS 17 it's not possible to use this command and you need a higher version?

Error Message:

File "<string>", line 3
    SPSSINC GETURI DATA URI="http://spss-seminar.de/youtube-1.sav".
                 ^
SyntaxError: invalid syntax
Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: get data /

Jon K Peck
You are not doing what I said.  I said not to put the command inside a begin program block.  Just run it the same way you would regular SPSS syntax.

Jon Peck
Senior Software Engineer, IBM
[hidden email]
312-651-3435




From:        drfg2008 <[hidden email]>
To:        [hidden email]
Date:        02/28/2011 07:56 AM
Subject:        Re: [SPSSX-L] get data /
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




thank you again,

I run exactly the following code:

BEGIN PROGRAM.
import spss,spssaux
SPSSINC GETURI DATA URI="
http://spss-seminar.de/youtube-1.sav".
END PROGRAM.


but the result ist an error message. May it be possible, that with SPSS 17
it's not possible to use this command and you need a higher version?

Error Message:

File "<string>", line 3
   SPSSINC GETURI DATA URI="
http://spss-seminar.de/youtube-1.sav".
                ^
SyntaxError: invalid syntax

-----
FUB

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/get-data-tp3403038p3403360.html
Sent from the SPSSX Discussion mailing list archive at 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

Reply | Threaded
Open this post in threaded view
|

Re: get data /

drfg2008

well, sorry for my stubbornness, but when I try this (without any begin - end prog.):


SPSSINC GETURI DATA URI="http://spss-seminar.de/youtube-1.sav".

I get this:

>Fehler Nr.  1.  Befehlsname: SPSSINC
>The first word in the line is not recognized as an SPSS command.
>Dieser Befehl wird nicht ausgeführt.

Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: get data /

Jon K Peck
That means that  you have not installed the command correctly.  The package contains an xml file that should go in the extensions subdirectory of your SPSS installation.  Then there is a .py file that can go there or in the site-packages directory under your Python version.  Please review the installation instructions in the readme file.

Jon Peck
Senior Software Engineer, IBM
[hidden email]
312-651-3435




From:        drfg2008 <[hidden email]>
To:        [hidden email]
Date:        02/28/2011 08:29 AM
Subject:        Re: [SPSSX-L] get data /
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




well, sorry for my stubbornness, but when I try this (without any begin -
end prog.):


SPSSINC GETURI DATA URI="
http://spss-seminar.de/youtube-1.sav".

I get this:

>Fehler Nr.  1.  Befehlsname: SPSSINC
>The first word in the line is not recognized as an SPSS command.
>Dieser Befehl wird nicht ausgeführt.



-----
FUB

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/get-data-tp3403038p3403427.html
Sent from the SPSSX Discussion mailing list archive at 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

Reply | Threaded
Open this post in threaded view
|

Re: get data /

drfg2008
Now, I understand: "Extension commands".[1] Didn't know of any existence yet.

Unfortunately Developer Central, were I was searching, has moved. So people like me are lost in outer space again, because when I follow the link, I get to http://www.spss.com/devcentral/index.cfm?pg=plugins

and there I only find python and R - which I have installed so far and which work perfectly.

Need a little more help, please. (URL ?)

Frank

[1]
http://www.mathkb.com/Uwe/Forum.aspx/spss/3731/SPSS-Statistics-17-Extension-Commands

Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: get data /

Jon K Peck
Go to the SPSS Community, as I said, at (www.ibm.com/developerworks/spssdevcentral).  You will have to register if you have not already done this.

Click on the Downloads for IBM SPSS Statistics

You will see a list of collections.  Click on Extension Commands or Utilities.  You will find SPSSINC_GETURI_DATA in the list.



Jon Peck
Senior Software Engineer, IBM
[hidden email]
312-651-3435




From:        drfg2008 <[hidden email]>
To:        [hidden email]
Date:        02/28/2011 09:19 AM
Subject:        Re: [SPSSX-L] get data /
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Now, I understand: "Extension commands".[1] Didn't know of any existence yet.

Unfortunately Developer Central, were I was searching, has moved. So people
like me are lost in outer space again, because when I follow the link, I get
to
http://www.spss.com/devcentral/index.cfm?pg=plugins

and there I only find python and R - which I have installed so far and which
work perfectly.

Need a little more help, please. (URL ?)

Frank

[1]
http://www.mathkb.com/Uwe/Forum.aspx/spss/3731/SPSS-Statistics-17-Extension-Commands



-----
FUB

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/get-data-tp3403038p3403530.html
Sent from the SPSSX Discussion mailing list archive at 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

Reply | Threaded
Open this post in threaded view
|

Re: get data /

drfg2008
In reply to this post by Jon K Peck
thank you, however there is still a little problem with it.

The folder:

C:\Program Files\SPSSInc\Statistics17\extensions

now contains:

SPSSINC_GETURI_DATA.py
SPSSINC_GETURI_DATA.spd
SPSSINC_GETURI_DATA.xml

Next, in SPSS Statistics, I tried to use Utilties>Install Custom Dialog to add this item to the menus (Extras - benutzerdefiniertes Dialogfeld installieren)

Well, that's the problem. When I use Utilities -> Install Custom Dialog I can find the SPSSINC_GETURI_DATA.spd in the extensions folder, however if I click on -open- a dialog appears: Installation am angebebenen Ort nicht möglich (Installation at the site not possible).




Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: get data /

Jon K Peck
Most likely you do not have write permission to the directory where the dialog would normally be installed.  (Vista plays tricks here and may make it appear that you do.)  You can specify an alternative location.  Look up the topic Managing Custom Dialogs under the Custom Dialog Builder for details.

Jon Peck
Senior Software Engineer, IBM
[hidden email]
312-651-3435




From:        drfg2008 <[hidden email]>
To:        [hidden email]
Date:        02/28/2011 02:45 PM
Subject:        Re: [SPSSX-L] get data /
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




thank you, however there is still a little problem with it.

The folder:

C:\Program Files\SPSSInc\Statistics17\extensions

now contains:

SPSSINC_GETURI_DATA.py
SPSSINC_GETURI_DATA.spd
SPSSINC_GETURI_DATA.xml

Next, in SPSS Statistics, I tried to use Utilties>Install Custom Dialog to
add this item to the menus (Extras - benutzerdefiniertes Dialogfeld
installieren)

Well, that's the problem. When I use Utilities -> Install Custom Dialog I
can find the SPSSINC_GETURI_DATA.spd in the extensions folder, however if I
click on -open- a dialog appears: Installation am angebebenen Ort nicht
möglich (Installation at the site not possible).






-----
FUB

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/get-data-tp3403038p3404056.html
Sent from the SPSSX Discussion mailing list archive at 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

Reply | Threaded
Open this post in threaded view
|

Re: get data /

drfg2008
it's probably vista

Managing Custom Dialogs says that I have to define the variable SPSS_CDIALOGS_PATH [1] to define an alternative location.

But where is SPSS_CDIALOGS_PATH



[1]
Umgebungsvariable SPSS_CDIALOGS_PATH definieren. Falls vorhanden, haben die in SPSS_CDIALOGS_PATH definierten Pfade Vorrang vor dem SPSS Statistics-Installationsverzeichnis. Trennen Sie mehrere Speicherorte in Windows durch einen Strichpunkt und bei Linux und Mac durch einen Doppelpunkt.

Wenn für die SPSS Statistics-Instanz, in die Sie kopieren, alternative Speicherorte für installierte Dialogfelder definiert wurden, können Sie den Kopiervorgang für einen beliebigen alternativen Speicherort durchführen und das Dialogfeld wird beim nächsten Start der Instanz als installiertes Dialogfeld erkannt.
Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: get data /

Albert-Jan Roskam
That message  says you can change the definition of the environment variable SPSS_CDIALOGS_PATH. In previous Windows versions (I'm trying to forget Vista asap, ugh!), environment variables could be defined by right-clicking My Computer, then go to Properties, Advanced. You can add a file path by using a semicolon as a separator, but it might be better to remove the current path and replace it with a file path for which you have complete access.
 
Cheers!!
Albert-Jan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



From: drfg2008 <[hidden email]>
To: [hidden email]
Sent: Tue, March 1, 2011 7:31:20 AM
Subject: Re: [SPSSX-L] get data /

it's probably vista

Managing Custom Dialogs says that I have to define the variable
SPSS_CDIALOGS_PATH [1] to define an alternative location.

But where is SPSS_CDIALOGS_PATH



[1]
Umgebungsvariable SPSS_CDIALOGS_PATH definieren. Falls vorhanden, haben die
in SPSS_CDIALOGS_PATH definierten Pfade Vorrang vor dem SPSS
Statistics-Installationsverzeichnis. Trennen Sie mehrere Speicherorte in
Windows durch einen Strichpunkt und bei Linux und Mac durch einen
Doppelpunkt.

Wenn für die SPSS Statistics-Instanz, in die Sie kopieren, alternative
Speicherorte für installierte Dialogfelder definiert wurden, können Sie den
Kopiervorgang für einen beliebigen alternativen Speicherort durchführen und
das Dialogfeld wird beim nächsten Start der Instanz als installiertes
Dialogfeld erkannt.


-----
FUB

--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/get-data-tp3403038p3404466.html
Sent from the SPSSX Discussion mailing list archive at 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

Reply | Threaded
Open this post in threaded view
|

Re: get data / Vista asap, ugh

drfg2008
Thanks!

I've got it! Finally.


yes, it's a Vista Problem: no access (even for admin).

The solution in Vista is quite simple (for those who might be interested):
[1] Start
[2] Systemsteuerung (Control Panel)
[3] System
[4] erweiterte Systemeinstellung (Advanced system settings)
[5] Umgebungsvariablen (Environment Variables)
[6] Systemvariablen: Neu / new environment variable
[7] Name der Variablen (name): SPSS_CDIALOGS_PATH
[8] Wert der Variablen (value): C:\<path>

In C:\<path> extract the ZIP-File

Then the usual process: Open any SPSS file and install it via pull-down menues

finished
Dr. Frank Gaeth