Chapter Contents

Previous

Next
CONVERT

CONVERT



Converts OSIRIS and SPSS system files to SAS data sets

Language element: procedure
OpenVMS specifics: All aspects are host-specific


Syntax
Details
Missing Values
Output Data Sets
OSIRIS Output
SPSS Output
Comparisons
Example
See Also

Syntax

PROC CONVERT product-specification <option(s)>;

product-specification
is required and can be one of the following:

OSIRIS=fileref-1 DICT=fileref-2
specifies a fileref or libref for the OSIRIS file to be converted into a SAS data set. If you use this product specification, you must also use the DICT= option, which specifies the OSIRIS dictionary to use.

SPSS=fileref
specifies a fileref or libref for the SPSS file to be converted into a SAS data set. The SPSS file can have the following formats:

  • SPSS-X format (whose originating operating environment is OpenVMS)

  • Portable File Format (from any operating environment).

option(s)
can be one or more of the following:

FIRSTOBS=n
specifies the number of the observation where the conversion is to begin. This option enables you to skip over observations at the beginning of the OSIRIS or SPSS system file.

OBS=n
specifies the number of the last observation to convert. This option enables you to exclude observations at the end of the file.

OUT=SAS-data-set
names the SAS data set that is created to hold the converted data. If the OUT= option is omitted, the SAS System still creates a data set and automatically names it DATAn, as if you omitted a data set name in a DATA statement. If it is the first such data set created in a job or session, the SAS System names it DATA1; the second is named DATA2, and so on. If the OUT= option is omitted, or if you do not specify a two-level name in the OUT= option, then the converted data set is stored in your WORK data library and by default is not permanent.


Details

The CONVERT procedure converts an OSIRIS or SPSS data file to a SAS data set. It produces one output data set but no printed output. The new data set contains the same information as the input system file; exceptions are noted in Output Data Sets. The OSIRIS and SPSS engines provide more extensive capabilities.

Because the OSIRIS and SPSS products are maintained by other companies or organizations, changes may be made that make the system files incompatible with the current version of PROC CONVERT. SAS Institute upgrades PROC CONVERT to support changes made to these products only when a new version of the SAS System is available.

Missing Values

If a numeric variable in the input data set has no value, or if it has a system missing value, PROC CONVERT assigns a missing value to it.

Output Data Sets

This section describes the attributes of the output SAS data set for each product-specification value.

CAUTION:
Be sure that the translated names are unique. Variable names can sometimes be translated by the SAS System. To ensure the procedure works correctly, be sure that your variables are named in such a way that translation results in unique names.  [cautionend]

OSIRIS Output

For single-response variables, the V1-V9999 name becomes the SAS variable name. For multiple-response variables, the suffix Rn is added to the variable name, where n is the response number. For example, V25R1 is the first response of the multiple-response variable V25. If the variable after V1000 has 100 or more responses, responses above 99 are eliminated. Numeric variables that OSIRIS stores in character, fixed-point binary, or floating-point binary mode become SAS numeric variables. Alphabetic variables become SAS character variables; any alphabetic variable that is longer than 200 is truncated to 200. The OSIRIS variable description becomes a SAS variable label, and OSIRIS print formats become SAS formats.

SPSS Output

SPSS variable names and variable labels become unchanged variable names and labels. SPSS alphabetic variables become SAS character variables of length 4. SPSS blank values are converted into SAS missing values. SPSS print formats become SAS formats, and the SPSS default precision of no decimal places becomes part of the variables' formats. SPSS value labels are not copied. DOCUMENT data are copied so that PROC CONTENTS can display them.


Comparisons

Using the CONVERT procedure is similar to using the OSIRIS and SPSS engines. For example, the following two programs provide identical results:

   /*  using the CONVERT procedure  */
filename xxx 'mybmdp.dat';
proc convert osiris=xxx out=temp;
run;
   /*  using the OSIRIS engine  */
libname xxx osiris 'myosiris.dat';
data temp;
    set xxx._first_;
run;

However, the OSIRIS and SPSS engines provide more extensive capability than PROC CONVERT.


Example

The following is an example of converting an OSIRIS file to a SAS data set, using a fileref named save:

filename save '[mydir]osiris.dat';

proc convert osiris=save;
run;

If you have more than one save file in the OSIRIS file referenced by fileref, then you can use two additional options in parentheses after the fileref. The CODE= option lets you specify the code of the save file that you want, and the CONTENT= option lets you specify the save file's content. For example, if a save file had CODE=JUDGES and CONTENT=DATA, you could use the following statements to convert the save file to a SAS data set:

filename save '[mydir]osiris1.dat';

proc convert osiris=save(code=judges content=data);
run;

See Also


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.