Chapter Contents

Previous

Next
BMDP

BMDP



Calls any BMDP program to analyze data in a SAS data set

UNIX specifics: all


Syntax
Details
PROC BMDP Statement
VAR Statement
BY Statement
PARMCARDS Statement
BMDP Control Statements
How Missing Values Are Handled
Using BMDP Programs that Need FORTRAN Routines
Example of Creating and Converting a BMDP Save File
See Also

Syntax

PROC BMDP <options>;
VAR variable-list;
BY variable-list;
PARMCARDS;
...BMDP control statements...
;


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.  [cautionend]

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=save-file
assigns a name to the BMDP save file that the BMDP procedure creates from a SAS data set. The save-file corresponds to the CODE sentence in the BMDP INPUT paragraph. For example, if you use the following statement the BMDP INPUT paragraph must contain 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.

CONTENT=DATA|CORR|FREQ|MEAN
lets BMDP know if your SAS data set is a standard SAS data set (CONTENT=DATA) or if it contains a correlation matrix (CORR), variable means (MEAN), or frequency counts (FREQ). You need not specify the CONTENT= option for specially structured SAS data sets that were created by other SAS procedures. If you omit the CONTENT= option, the data set's TYPE value is used.

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.  [cautionend]

DATA=SAS-data-set
specifies the SAS data set that you want the BMDP program to process. If you do not specify the DATA= option, PROC BMDP uses the most recently created SAS data set.

INPUTFILE=filename
indicates the file in which the procedure will place the converted BMDP save file. It should match the name used in the INPUT paragraph of the BMDP control language.

LABEL=variable
specifies a variable whose values are to be used as case labels for BMDP. Only the first four characters of the values are used. The LABEL= variable must also be included in the VAR statement, if you use one.

LABEL2=variable
specifies a variable whose values are to be used as second case labels for BMDP; as with the LABEL= option, only the first four characters are used. The LABEL2= variable must also be given in the VAR statement, if you use one.

NOMISS
specifies that you want the BMDP program or save file to exclude observations with missing values.

PROG=BMDPnn
specifies the BMDP program that you want to run. For example, the following PROC BMDP statement runs the BMDP3S program:
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.  [cautionend]

UNIT=n
specifies the FORTRAN logical unit number for the BMDP save file that the BMDP procedure creates. The value that you specify for n must correspond to the UNIT value specified in the INPUT paragraph of the BMDP control language.

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.  

WRKSPCE=nn|PARM=nn
controls the allocation of a workspace in BMDP. The WRKSPCE= or PARM= value is passed as a parameter to BMDP programs and corresponds to the WRKSPCE= feature in BMDP MVS cataloged procedures. The default value for nn is 30.


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;
[1] DATA TEMP creates a SAS data set called TEMP.
[2] The CONTENTS procedure shows the descriptive information for the data set TEMP.
[3] 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.
[4] PROC BMDP calls the BMDP program BMDP1D to analyze the data set TEMP.

The input BMDP save file, temp.dat, is specified both in the INPUTFILE= option and in the FILE sentence of the INPUT paragraph. The CODE sentence specifies the TEMP data set. The results are saved in the BMDP save file BOUT, which is stored in temp.dat, as specified in the SAVE paragraph.

[5] 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.

[6] 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.