Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: How to read a very old SPSS file?


From   Sergiy Radyakin <[email protected]>
To   [email protected]
Subject   Re: st: How to read a very old SPSS file?
Date   Fri, 4 Feb 2011 23:05:23 -0500

Dear Stephen,

as the author of the -usespss- command for reading SPSS files into
Stata I am particularly interested in a historical file like this.
Provided that the tapes were converted correctly (no data transfer
errors), I believe it will be possible to get your data into Stata
(though not with the released version of -usespss-).

If you are interested, please provide me with the file and as much
information about it as you have, such as:
original filename, name and version of the machine, OS, software that
produced the file, conversion steps taken including
description of data transfer attempts, if you have any codebooks,
variables lists, frequency tabulations, etc.

If the file in question is completely confidential, think whether
there is another file, produced by the same system that is available.
It may very well be sufficient to determine what tweaks -usespss-
requires to read it in.

If you can't provide any complete data file, you may find it possible
to share the first couple of hundreds bytes from the file header. The
information
there will not contain person-related data.

You can obtain it with the hexdump command (without the analyze
option, which is useless in this case). The output like this can
already help in identifying the steps necessary to convert the data:

                 |                                         |    character
                 |           hex representation            |  representation
         address |  0 1  2 3  4 5  6 7  8 9  a b  c d  e f | 0123456789abcdef
-----------------+-----------------------------------------+-----------------
               0 | 2446 4c32 4028 2329 2053 5053 5320 4441 | $FL2@(#) SPSS DA
              10 | 5441 2046 494c 4520 5350 5353 2066 6f72 | TA FILE SPSS for
              20 | 2055 6e69 7820 5265 6c65 6173 6520 362e |  Unix Release 6.
              30 | 3120 2853 6f6c 6172 6973 2032 2e33 2900 | 1 (Solaris 2.3).

Ideally write a small Stata program to read the file byte by byte (in
binary mode, read as unsigned byte, not Stata byte) and
dump into another file the first N bytes, verify with hexdump that the
first bytes of two files are the same, then send the smaller file to
me.
You can use my World Bank address for this: sradyakin(/at/)worldbank.org
This will save me time of punching the hex codes into my editor.


Best Regards,
   Sergiy Radyakin






On Fri, Feb 4, 2011 at 5:48 PM,  <[email protected]> wrote:
> I have a file which was originally written in SPSS binary data file format in around 1980 onto magnetic tape from which the file image has been taken. The original file was in EBCDIC format written by an IBM computer or clone thereof. I have also converted the file to ASCII format using UltraEdit's built-in converter.   I don't have access to any version of SPSS nowadays.  This is the only copy remaining of a historic data set.
>
> I want to read these data into Stata (of course!). Tips please.
>
> Tried so far (using the ascii format version of the file):
>
> * Stat/Transfer version 10 conversion failed: "Processing SPSS dataset dictionary was stopped because of the error (3)"
> * SPSS version 6 (c. 1989): a former colleague tried reading with this and it failed
>
> In case it's useful, here is a hexdump from the file, derived using Stata's -hexdump- command:
>
> ======================================================
> . hexdump iserdump1_ue.txt , analyze
>
>  Line-end characters                        Line length (tab=1)
>   \r\n         (Windows)              2      minimum        0
>   \r by itself (Mac)                599      maximum   21,074
>   \n by itself (Unix)             1,077
>  Space/separator characters                 Number of lines    1,679
>   [blank]                         2,964      EOL at EOF?       no
>   [tab]                           1,749
>   [comma] (,)                     1,260    Length of first 5 lines
>  Control characters                           Line 1      615
>   binary 0                    2,574,907      Line 2        3
>   CTL excl. \r, \n, \t          252,933      Line 3      973
>   DEL                               947      Line 4      525
>   Extended (128-159,255)        106,948      Line 5      989
>  ASCII printable
>   A-Z                            99,890
>   a-z                            21,142    File format   BINARY
>   0-9                             8,824
>   Special (!@#$ etc.)           142,054
>   Extended (160-254)            231,999
>                         ---------------
>  Total                         3,447,297
>
>  Observed were:
>    \0 ^A ^B ^C ^D ^E ^F ^G ^H \t \n ^K ^L \r ^N ^O ^P ^Q ^R ^S ^T ^U ^V ^W
>    ^X ^Y ^Z Esc 28 29 30 31 blank ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5
>    6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y
>    Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | }
>    ~ DEL 128 E^A E^B E^C E^D E^F E^G E^H E^I E^J E^K E^L E^M E^N E^O E^P
>    E^Q E^R E^S E^T E^U E^V E^W E^X E^Y E^Z 155 156 157 158 160 ¡ ¢ £ ¤ ¥ ¦
>    § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ . ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê
>    Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Ö × Ù Ú Û Ü Ý Þ ß à á â ã ä æ ç è é ê ë ì í î ï ð ñ
>    ò ó ô õ ö ÷ ø ù ú û ü ý þ 255
>
> ======================================================
>
> Thanks
> Stephen
> -------------------------------------
> Stephen P. Jenkins  <[email protected]>
> Department of Social Policy and STICERD/CASE
> London School of Economics and Political Science
> Houghton Street
> London WC2A 2AE, U.K.
> Tel. +44 (0)20 7955 6527
> Survival Analysis using Stata:
> http://www.iser.essex.ac.uk/survival-analysis
> Downloadable papers and software: http://ideas.repec.org/e/pje7.html
>
>
> Please access the attached hyperlink for an important electronic communications disclaimer: http://lse.ac.uk/emailDisclaimer
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index