Chapter Contents |
Previous |
Next |
BMDP |
UNIX specifics: | all |
Syntax |
PROC BMDP <options>;
|
Details |
BMDP is a library of statistical analysis programs maintained by BMDP Statistical Software Inc. Use the BMDP procedure in SAS programs to
Note: The BMDP procedure is available for the AIX,
HP-UX,
and Solaris operating environments only.
You can analyze SAS data sets with BMDP programs by invoking this procedure. You can use the BMDP procedure any number of times to invoke BMDP. Before using the BMDP procedure, you must have access to the BMDP programs from your host because the procedure invokes them. Ask your system administrator for the location of the BMDP programs. To use the BMDP procedure, first specify the name of the BMDP program you want to invoke in the PROC BMDP statement. The VAR and BY statements can follow, although they are optional. The BMDP control statements follow the PARMCARDS statement.
To analyze BMDP data with the SAS System, create a BMDP save file in a BMDP program and then convert the save file to a SAS data set with the CONVERT procedure or use the BMDP engine. See The BMDP Engine for more information on the BMDP engine.
PROC BMDP Statement |
PROC BMDP <options>; |
The following options can be used in the PROC BMDP statement:
CODE='JUDGES'
:
proc bmdp prog=bmdp3s code=judges;
CODE= is usually not necessary in the PROC BMDP statement. When CODE= is not specified, the name of the BMDP save file is the SAS data set name.
If you are converting a SAS data set to a BMDP save file, name the save file in the CODE sentence of the BMDP INPUT paragraph. To use the name of the SAS data set, specify that name in the CODE sentence. If you use a different name, it must match the name supplied in the CODE= option.
Note: BMDP may use a structure for
special data sets (for example, a correlation matrix) that is different from
the SAS structure. Be sure that the input SAS data set is in the form that
BMDP expects.
proc bmdp prog=bmdp3s;
Note: If you only want
to convert a SAS data set to a BMDP save file and do not want to run a BMDP
program, omit the PROG= option and include the UNIT= option.
If you omit this option, n defaults to 3 and FT03F001 is used as the fileref for the save file. The following message is also printed:
Note: The UNIT= option was not specified. Unlike Version 5, the UNIT= option is required. Therefore, UNIT=3 is assumed. Ensure that the INPUT paragraph uses UNIT=3, or explicitly specify the correct UNIT value.
VAR Statement |
VAR variable-list |
The VAR statement specifies the variables to be used in the BMDP program. When you do not include a VAR statement, the BMDP program uses all the numeric variables in the SAS data set.
BY Statement |
BY variable-list |
Use the BY statement with the BMDP procedure to obtain separate analyses on observations in groups that are defined with the BY variables. When you use a BY statement, the procedure expects the input data set to be sorted in order of the BY variables or to have an appropriate index. If your input data set is not sorted in ascending order, you can do one of the following:
If a BY statement is used, it is printed with the BMDP printed output to distinguish the BY group output.
For more information on the BY statement, see SAS Language Reference: Dictionary.
PARMCARDS Statement |
PARMCARDS; |
The PARMCARDS statement signals that the BMDP control language follows.
BMDP Control Statements |
Put your BMDP control language after the PARMCARDS statement. These are similar for all BMDP programs; see the most current BMDP manual for information on their forms and functions.
The BMDP INPUT paragraph must include UNIT and CODE sentences. Their values must match the UNIT= and CODE= values given in the PROC BMDP statement. (If the PROC BMDP statement does not specify a UNIT= value, use 3 as the UNIT= value in the BMDP statements.) Use the SAS data set name as the CODE value unless you have specified a different name with the CODE= option in the PROC BMDP statement. Omit the VARIABLES paragraph from the BMDP statements because it is not needed when your input is a save file.
How Missing Values Are Handled |
Before the BMDP procedure sends data to BMDP, it converts missing SAS values to the standard BMDP missing value. When you use the NOMISS option in the PROC BMDP statement, observations with missing values are not sent to the BMDP program.
Using BMDP Programs that Need FORTRAN Routines |
Some BMDP programs, such as the ones for nonlinear regression, need to invoke the FORTRAN compiler and linkage editor before executing. All BMDP compilation and link editing must be completed before you use PROC BMDP.
Example of Creating and Converting a BMDP Save File |
The following code converts the BMDP save file BOUT to the SAS data set FROMBMDP.
data temp;[1] input a b c; cards; datalines; 1 2 3 4 5 6 7 8 9 ; run; proc contents;[2] title 'CONTENTS OF SAS DATA SET TO BE RUN THROUGH BMDP1D'; run; options parmcards=bmdpcntl;[3] filename bmdpcntl 'bmdp.inp'; proc bmdp prog=bmdp1d data=temp inputfile='temp.dat';[4] parmcards; /prob title='SHOW SAS/BMDP INTERFACE'. /input file='temp.dat'. code='TEMP'. /save code='BOUT'. new. file='bout.dat'. /end /finish ; run; filename fromfile 'bout.dat';[5] proc convert bmdp=fromfile out=frombmdp; run; proc contents;[6] title 'SAS DATA SET CONVERTED FROM BMDP SAVE FILE'; run; proc print; run;
DATA TEMP creates a SAS data set called TEMP. | |
The CONTENTS procedure shows the descriptive information for the data set TEMP. | |
The PARMCARDS= option gives a fileref for the parmcards file. The FILENAME statement indicates what file corresponds to that fileref for the PARMCARDS file. PROC BMDP gives the PARMCARDS file to the BMDP program. | |
PROC BMDP calls the BMDP program
BMDP1D to analyze the data set TEMP.
The input BMDP save file,
| |
The FILENAME statement associates
the FROMFILE fileref with the
bout.dat file, which contains
the BOUT save file.
The CONVERT procedure converts the BMDP save file BOUT to the SAS data set FROMBMDP. The BMDP= option is set to FROMFILE, since PROC CONVERT requires a fileref with the BMDP= option. | |
The CONTENTS and PRINT procedures show the new SAS data set, FROMBMDP. |
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.