Chapter Contents

Previous

Next
CONVERT

CONVERT



Converts BDMP, OSIRIS and SPSS/PC system files to SAS data sets

Windows specifics: All


Syntax
Details
Missing Values
Output Data Sets
BMDP output
OSIRIS Output
SPSS Output
Comparison
See Also

Syntax

PROC CONVERT product-specification <option(s)>

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

BDMP=fileref <(CODE=codeCONTENT=content-type)>
converts into a SAS data set the first member a BMDP save file created under DOS. Here is an example:
   filename save 'c:\myidr\bmdp.dat';
   proc convert bmdp=save;
   run;

If you have more than one save file in the BMDP file referenced by the fileref argument, you can use two options in parentheses after fileref. The CODE= option lets you specify the code of the save file you want, and the CONTENT= option lets you give the content of the save file. For example, if a file with CODE=JUDGES has a content of DATA, you can use the following statement:

   filename save 'c:\mydir\bmdpl.dat';
   proc convert bmdp=save(code=judges
                          content=data);
   run;

OSIRIS=fileref
specifies a fileref 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 for the SPSS/PC file to be converted into a SAS data set. The SPSS/PC file can be in the following formats:

  • SPSS/PC format (created under DOS).

  • SPSS Portable File Format (from any operating environment). This format is also called the export format.

option-list

DICT=fileref
specifies a fileref of the dictionary file for the OSIRIS file. The DICT= option is valid only when used with the OSIRIS product specification.

FIRSTOBS=n
gives the number of the observation where the conversion is to begin. This enables you to skip over observations at the beginning of the OSIRIS or SPSS/PC 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 created to hold the converted data. If the OUT= option is omitted, the SAS System still creates a WORK data set and automatically names it DATAn, just as if you omitted a data set name in a DATA statement. If it is the first such data set in a job or session, the SAS System names it DATA1, the second is DATA2, and so on. If the OUT= option is omitted or if you do not specify a two-level name (including a libref) in the OUT= option, the converted data set is stored in your WORK data library and by default it is not permanent.


Details

The CONVERT procedure converts a BMDP, 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 BMDP, OSIRIS and SPSS engines provide more extensive capabilities.

Because the BMDP, OSIRIS and SPSS/PC 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 only upgrades PROC CONVERT to support changes made to these products when a new version of the SAS System is available.

Missing Values

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

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 your variables are named in such a way that translation results in unique names.  [cautionend]

BMDP output

Variable names from the BMDP save file are used in the SAS data set, but nontrailing blanks and all special characters are converted to underscores in the SAS variable names. The subscript in BMDP variable names, such as x(1), becomes part of the SAS variable name, with the parentheses omitted: X1. Alphabetic BMDP variables become SAS character variables of corresponding length. Category records from BMDP are not accepted.

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. 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 of length greater 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 variable names and labels without change. SPSS alphabetic variables become SAS character variables. SPSS blank values are converted to 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.


Comparison

The CONVERT procedure is closely related to the BMDP, OSIRIS and SPSS interface library engines. (In fact, the CONVERT procedure uses these engines.) For example, the following two sections of code provide identical results:

However, the BMDP, OSIRIS and SPSS engines have more extensive capabilities than PROC CONVERT.

See Also


Chapter Contents

Previous

Next

Top of Page

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