Chapter Contents |
Previous |
Next |
CONVERT |
UNIX specifics: | all |
Syntax |
PROC CONVERT product-specification <option-list>; |
Details |
The CONVERT procedure converts BMDP, OSIRIS, and SPSS system files to SAS data sets. The procedure is supplied for compatibility with Version 5. The procedure invokes the appropriate engine to convert files.
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 in How Missing Values Are Handled.
The procedure converts system files from these three products:
Because the BMDP, OSIRIS, and SPSS products are maintained by other organizations, changes may be made that make new system files incompatible with the current version of PROC CONVERT. SAS Institute upgrades PROC CONVERT to support changes to these products only when a new version of the SAS System is available.
In the PROC CONVERT statement, product-specification is required and can be one of the following:
filename save '/usr/mydir/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 specifies the code of the save file that you want, and the CONTENT= option specifies the content of the save file. For example, if a file with CODE=JUDGES has a content of DATA, you can use the following statements:
filename save '/usr/mydir/bmdp.dat'; proc convert bmdp=save(code=judges content=data); run;
How Missing Values Are Handled |
If a numeric variable in the input data set has no value or a system missing value, 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.
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.
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 where n is the response. For example, V25R1
would be the first response of the multiple-response 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.
SPSS variable names and variable labels become variable names and labels without change. SPSS alphabetic variables become SAS character variables of the same length. 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. The SPSS DOCUMENT data is copied so that the CONTENTS procedure can display it. SPSS value labels are not copied.
File Conversion Examples |
These three examples show how to convert BMDP, OSIRIS, and SPSS files to SAS data sets.
filename bmdpfile 'bmdp.savefile'; proc convert bmdp=bmdpfile out=temp; run;
filename osirfile 'osirdata'; filename dictfile 'osirdict'; proc convert osiris=osirfile dict=dictfile out=temp; run;
filename spssfile 'spssfile.num1'; proc convert spss=spssfile out=temp; run;
Comparison with Interface Library Engines |
The CONVERT procedure is closely related to the interface library engines BMDP, OSIRIS, and SPSS. (In fact, the CONVERT procedure uses these engines.) For example, the following two sections of code provide identical results:
filename myfile 'mybmdp.dat'; proc convert bmdp=myfile out=temp; run; libname myfile bmdp 'mybmdp.dat'; data temp; set myfile._first_; run;
However, the BMDP, OSIRIS, and SPSS engines provide more extensive capability than PROC CONVERT. For example, PROC CONVERT converts only the first BMDP member in a save file. The BMDP engine, in conjunction with the COPY procedure, copies all members.
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.