Chapter Contents

Previous

Next
CONVERT

CONVERT



Converts BMDP, OSIRIS, and SPSS system files to SAS data sets

CMS specifics: all


Syntax
Details
PROC CONVERT Statement
How Missing Values Are Handled
How Variable Names Are Assigned
Variable Names in BMDP Output
Variable Names in OSIRIS output
Variable Names in SPSS output
See Also

Syntax

PROC CONVERT <options>;


Details

The CONVERT procedure converts BMDP, OSIRIS, and SPSS system files to SAS data sets.

PROC CONVERT 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 under How Variable Names Are Assigned.

The procedure converts system files from these packages:

These software packages are products of other organizations. Changes, therefore, can be made that make new system files incompatible with the current version of PROC CONVERT. SAS Institute cannot be responsible for upgrading PROC CONVERT to support changes to the packages listed previously; however, attempts will be made to do so as necessary with each new release of SAS.


PROC CONVERT Statement


Syntax

PROC CONVERT <options>;

For the PROC CONVERT statement, options can be from any of those in the options list presented later in this section. Only one of the options specifying a system file (BMDP, OSIRIS, or SPSS) can be included. Usually, only the PROC CONVERT statement is used, although data set attributes can be controlled by specifying the DROP=, KEEP=, or RENAME= data set options with the OUT= option in this procedure. Refer to SAS Language Reference: Dictionary for more information about these data set options. You can also use the LABEL and FORMAT statements following the PROC CONVERT statement.

In the following descriptions, fileref is the logical name that you associate with a permanent filename by issuing a SAS FILENAME statement. For example, the following SAS statement associates the logical name BMDPFILE with the CMS file BMDP SAVEFILE A. After defining fileref, use it in your program to reference the permanent filename.

filename bmdpfile 'bmdp savefile a';

Instead of a fileref, you can use a libref if you reference the correct engine (BMDP, SPSS, or OSIRIS) in the LIBNAME statement. For example, you can use the following LIBNAME statement to assign a libref to BMDP SAVEFILE A:

libname bmdpfile bmdp 'bmdp savefile a';

You can use the following options with the PROC CONVERT statement:

BMDP=fileref |libref <(CODE=code-id CONTENT= content-type )>
specifies the logical name of a BMDP save file. By default, the first save file in the data set is converted. If you have more than one save file in the data set, you can use two additional options in parentheses after the logical name. The CODE= option lets you specify the code of the save file that you want, and the CONTENT= option lets you give the save file's content. For example, if a file CODE=JUDGES has CONTENT=DATA, you can use this statement:
proc convert bmdp=save(code=judges content=data);

DICT=fileref |libref
specifies the logical name of a data set containing the dictionary file for the OSIRIS data set. The OSIRIS= option must be specified if you use the DICT= option.

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

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

OSIRIS=fileref |libref
specifies a logical name for a data set containing an OSIRIS file. You must also include the DICT= option, described earlier, when you use the OSIRIS= option.

OUT=SAS-data-set
names the SAS data set created to hold the converted data. If the OUT= option is omitted, SAS 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, SAS 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 in the OUT= option, the data set converted to SAS format is not permanently saved. See Handling Space in the WORK Library for more information.

SPSS=fileref |libref
specifies a logical name for a data set containing an SPSS file. The SPSS file can be in any of three formats: SPSS Release 9 (or prior), SPSS-X format (whose originating operating environment is OS/390, CMS, or VSE), or Portable File Format from any operating environment.


How Missing Values Are Handled

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


How Variable Names Are Assigned

The following sections explain how names are assigned to the SAS variables created by the CONVERT procedure.

CAUTION:
Be sure that the translated names are unique.   [cautionend]
Variable names are translated as indicated in the following sections.

Variable Names in BMDP Output

Variable names from the BMDP save file are used in the SAS data set, except that 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 length 4. Category records from BMDP are not accepted.

Variable Names in OSIRIS output

For single-response variables, the V1 through V9999 name becomes the SAS variable name. For multiple-response variables, the suffix Rn is added to the variable name, when 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 format information becomes a SAS format.

Variable Names in SPSS output

SPSS variable names and variable labels become variable names and labels without change. SPSS alphabetic variables become SAS character variables of length 4. 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 variable's formats. The SPSS DOCUMENT data are copied so that the CONTENTS procedure can display them. SPSS value labels are not copied.

See Also


Chapter Contents

Previous

Next

Top of Page

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