Chapter Contents

Previous

Next
BMDP

BMDP



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

CMS specifics: all


Syntax
Details
PROC BMDP Statement
VAR Statement
BY Statement
PARMCARDS Statement
How Missing Values Are Handled
Invoking BMDP Programs That Need FORTRAN Routines
Example of Creating and Converting a BMDP Save File
REFERENCE

Syntax

PROC BMDP <options>;
VAR variables;
BY variables;
PARMCARDS;
BMDP control statements;


Details

BMDP is a library of statistical analysis programs originally developed at the UCLA Health Sciences Computing Facility.

You can use the BMDP procedure in SAS programs to

The BMDP procedure and the BMDP program that it invokes can require a large virtual machine, so you may have to increase your machine's virtual storage. To use the BMDP procedure in a SAS session, invoke SAS wth the statement:

sasbmdp8

This command invokes an EXEC that sets up the necessary filerefs for BMDP. If this command is not available on your computer system, ask your computing center staff for help in setting it up.

To use the BMDP procedure, first specify the name of the BMDP program that you want to invoke in the PROC BMDP statement. (Note that a MODULE file must be present for the BMDP program that you want to run.) The VAR and BY statements can follow this, but they are optional. Then, specify the PARMCARDS statement and your BMDP control language. SAS prints the BMDP program output as part of the SAS log. You can use the BMDP procedure multiple times in your SAS job.


PROC BMDP Statement


Syntax

PROC BMDP <options>;

CODE=save-file
assigns a name to the BMDP save file that the BMDP procedure creates from a SAS data set. The save-file argument corresponds to the CODE sentence in the BMDP INPUT paragraph. For example, if you use the following statement, the BMDP INPUT paragraph must contain the sentence CODE='JUDGES'.
proc bmdp prog=bmdp3s code=judges;

The CODE= option is usually not necessary in the PROC BMDP statement. When the CODE= is not specified, the name of the BMDP save file is the SAS data set name.

CONTENT=CORR|DATA|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 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, the BMDP procedure uses the most recently created SAS data set.

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

LABEL2=variable
specifies a character 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 variable for the LABEL2= option must also be given in the VAR statement if you use one.

NOMISS
specifies that you want the BMDP procedure to exclude observations with missing values from being passed to the BMDP program.

PROG=BMDPnn
specifies the BMDP program that you want to run. If you do not want to run a BMDP program, but just want to convert a SAS data set to a BMDP save file, omit this option and use the UNIT= option. The following PROC BMDP statement runs the BMDP3S program.
proc bmdp prog=bmdp3s;

Note:   The BMDP MODULE file must be present for the program to run. In some versions of BMDP, MODULE files are provided. Otherwise, you need to create a MODULE file. For help on creating a MODULE file, see your system administrator.  [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 that is specified in the INPUT paragraph of the BMDP control language.

If you omit this option, the n argument defaults to 3 and FT03F001 is used as the fileref for the save file. A warning message is also printed, indicating that 3 is being used as the unit number.


VAR Statement


Syntax

VAR variables;

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


Syntax

BY variables;

Use the BY statement with the BMDP procedure to obtain separate analyses on observations in groups defined with the BY variables. When you use a BY statement, ensure that the observations in the input SAS data set are sorted in the order of the variables listed in the BY statement, or that the data set has an appropriate index. See SAS Language Reference: Dictionary for details on what constitutes an appropriate index.

If a BY statement is used, it is printed with the BMDP printed output to distinguish the BY-group output. The BMDP output is printed as part of the SAS listing file.


PARMCARDS Statement


Syntax

PARMCARDS;

The PARMCARDS statement signals that the BMDP control language follows. This is 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= option and CODE= option values given in the PROC BMDP statement. (If the PROC BMDP statement does not specify a value for the UNIT= option, 3 is used 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 since 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 values. When you use the NOMISS option in the PROC BMDP statement, observations with missing values are excluded from the data set sent to the BMDP program.


Invoking BMDP Programs That Need FORTRAN Routines

Some BMDP programs, such as those for nonlinear regression, may need to invoke the FORTRAN compiler and linkage editor before executing. All BMDP compilation and link editing must be completed before using PROC BMDP.


Example of Creating and Converting a BMDP Save File

The following actions occur in PROC BMDP Example:


PROC BMDP Example
data temp; input a b c; cards; 1 2 3 4 5 6 7 8 9 ; proc contents; title 'SAS DATA SET TO BE RUN THROUGH BMDP1D'; run; proc bmdp prog=bmdp1d data=temp unit=3; parmcards; /prob title='SHOW SAS/BMDP INTERFACE'. /input unit=3. code='TEMP'. /save code='BOUT'. new. unit=4. /end /finish ; proc convert bmdp=ft04f001 out=frombmdp;run; proc contents; title 'SAS DATA SET CONVERTED FROM BMDP SAVE FILE'; run; proc print; run;

The output from PROC BMDP Example is shown in Output of the PROC BMDP Example.

Output of the PROC BMDP Example
 1             CONTENTS OF SAS DATA SET TO BE RUN THROUGH BMDP1D            1
                                                 12:37 Friday, March 15, 1999
                                                                             
                             The CONTENTS Procedure                          
                                                                             
 Data Set Name: WORK.Temp                            Observations:         3 
 Member Type:   DATA                                 Variables:            3 
 Engine:        V8                                   Indexes:              0 
 Created:       12:37 Friday, March 15, 1999         Observation Length:   24
 Last Modified: 12:37 Friday, March 15, 1999         Deleted Observations: 0 
 Protection:                                         Compressed:           NO
 Data Set Type:                                      Sorted:               NO
 Label:                                                                      
                                                                             
                 -----Engine/Host Dependent Information-----                 
                                                                             
        Data Set Page Size:         8192                              
        Number of Data Set Pages:   1                                 
        First Data Page:            1                                 
        Max Obs per Page:           338                               
        Obs in First Data Page:     3                                 
        Number of Data Set Repairs: 0
        File Name:                  Temp Work A
        Release Created:            7.0000B2
        Release Last Modified:      7.0000B2
        Host Created:               VM/ESA
        Last Modified by:           BMDP90V8
        Owner Name:                 
  
  
  
            -----Alphabetic List of Variables and Attributes-----            
                                                                             
                     #    Variable    Type    Len    Pos                     
                     -----------------------------------                     
                     1    a           Num       8      0                     
                     2    b           Num       8      8                     
                     3    c           Num       8     16                     
                                        


REFERENCE

Dixon, W.D., Brown, M.B., Engleman, L., Frane, J.W., Hill, M.A., Jennrich, R.I., and Toporek, J.D., eds. (1981), BMDP Statistical Software 1981, Los Angeles: University of California Press.


Chapter Contents

Previous

Next

Top of Page

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