GET DATA & FILE HANDLE

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

GET DATA & FILE HANDLE

Albert-Jan Roskam
Hi dear list,

I use the following syntax to to get an ASCII data
file without file extension, named 'data2005'.

GET DATA  /TYPE = TXT
 /FILE = '\\Srvr\dbase\2005\data\data2005'
 /FIXCASE = 1
 /ARRANGEMENT = FIXED
 /FIRSTCASE = 1
 /IMPORTCASE = ALL
 /VARIABLES =
 name        0-7     A8
 year        8-9     A2 .

----> This works, however, I would like to get rid of
the file path, for example by using a FILE HANDLE.
(The reason for this is that we use a dedicated batch
program which does not accept file paths inside a
syntax.
They need to be specifed in the batch file. I still
want to retain this info by including FILE HANDLES,
even if I would have to put an asterisk before them

when I batch run the entire dataset).

Therefore I tried the following:

file handle data2005 / name =
'\\Srvr\dbase\2005\data\data2005'.

GET DATA  /TYPE = TXT
 /FILE = data2005
 /FIXCASE = 1
 /ARRANGEMENT = FIXED
 /FIRSTCASE = 1
 /IMPORTCASE = ALL
 /VARIABLES =
 name        0-7     A8
 year        8-9     A2 .


----> This does NOT work! Why not?

----> Being persistent, I tried another solution --
which also did't work,
even though the MPRINT output displays the desired
code.

set mprint = on.
define data2005 () '\\Srvr\dbase\2005\data\data2005'
!enddefine.
* define data2005 ()
!quote('\\Srvr\dbase\2005\data\data2005') !enddefine.
/* didn't work either */.



GET DATA  /TYPE = TXT
 /FILE = data2005
 /FIXCASE = 1
 /ARRANGEMENT = FIXED
 /FIRSTCASE = 1
 /IMPORTCASE = ALL
 /VARIABLES =
 name        0-7     A8
 year        8-9     A2 .


---> Does anybody know how to make the above GET DATA
statement work?

Thanks in advance, as always!

Best wishes,
Albert-Jan




Cheers!
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did you know that 87.166253% of all statistics claim a precision of results that is not justified by the method employed? [HELMUT RICHTER]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html
Reply | Threaded
Open this post in threaded view
|

Python; where can os and wx module be found?

P.van Groenestijn
Dear List,

I try to learn Python with help the 4th edition of Levesque's SPSS
Programming and Data Management. One can download several python files from
http://www.spss.com/devcentral/ . I was able to do this with spssaux. In
the example with simple file chooser (pag231), however, I need both wx
module and the os module. Where can I found these file for downloading?

Best Regards,
Pieter van Groenestijn
University of Nijmegen
The Netherlands
Reply | Threaded
Open this post in threaded view
|

Re: Python; where can os and wx module be found?

Peck, Jon
The os module is part of the Python standard library, so you can just import it.

To find third party modules such as wxPython, go to the Python Cheeseshop

http://www.python.org/pypi/

That site maintains an index of such modules.

In particular, the wxPython material can be downloaded from
http://www.python.org/pypi/wxPython/2.6.3.2

Regards,
Jon Peck

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Pieter van Groenestijn
Sent: Wednesday, May 09, 2007 8:56 AM
To: [hidden email]
Subject: [SPSSX-L] Python; where can os and wx module be found?

Dear List,

I try to learn Python with help the 4th edition of Levesque's SPSS
Programming and Data Management. One can download several python files from
http://www.spss.com/devcentral/ . I was able to do this with spssaux. In
the example with simple file chooser (pag231), however, I need both wx
module and the os module. Where can I found these file for downloading?

Best Regards,
Pieter van Groenestijn
University of Nijmegen
The Netherlands