Bookmark and Share

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

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

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

From   "Michael N. Mitchell" <>
Subject   Re: st: How to read a very old SPSS file?
Date   Fri, 04 Feb 2011 18:27:53 -0800

Dear Stephen

I fret that this may be a bordeline hopeless situation. When I was back at UCLA working on our mainframe version of SPSS, we encountered situations like this frequently. The SPSS binary file in EBCDIC format needs to be read using an IBM mainframe version of SPSS. Converting the binary file into ASCII does not aid in the reading of the file, and all it really does is mangle the file. You can see in the -hexdump- command that a majority of the characters are not really ASCII characters.

If it was a matter of life and death to read this file, there are two ways I can imagine doing reading this file...

1) finding a place that has SPSS running on an IBM mainframe and ask them to convert the file into an SPSS portable (.por) file. The EBCDIC file would need to be transferred, and if you use FTP be sure to use BINARY transfer protocol. That could then be read by a modern version of SPSS or probably Stat/Transfer. It is possible that SPSS may still have such a computer, or be able to refer you to someone who owns one.

2) Locate a document that describes the exact IBM mainframe file format of the SPSS file and write a program that reads the file, byte by byte, acconting for the EBCDIC format. In short, you would be writing your own version of Stat/Transfer specifically for reading IBM mainframe SPSS EBCDIC files.

I hope this helps,

Best luck!

Michael N. Mitchell
Data Management Using Stata      -
A Visual Guide to Stata Graphics -
Stata tidbit of the week         -

On 2011-02-04 2.48 PM, 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


Stephen P. Jenkins<>
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:
Downloadable papers and software:

Please access the attached hyperlink for an important electronic communications disclaimer:

*   For searches and help try:
*   For searches and help try:

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