Chapter Contents

Previous

Next
BMDP

BMDP



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

OS/390 specifics: all


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

Syntax

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


Details

BMDP is a library of statistical analysis programs that were originally developed at the UCLA Health Sciences Computing Facility. Use the BMDP procedure in SAS programs to:

In order to use the BMDP procedure in a SAS session, the JCL EXEC statement must request the cataloged procedure SASBMDP rather than the usual cataloged procedure SAS. If the SASBMDP cataloged procedure is not available on your computer system, or if it has a different name, ask your computing center staff to help you set it up. Your SAS Installation Representative has the SAS System installation instructions, which include directions for setting up the procedure.

You can use BMDP programs to analyze SAS data sets by invoking this procedure. To analyze BMDP data with the SAS System, create a BMDP "save" file in a BMDP program, and then use the SAS CONVERT procedure or the BMDP engine to convert the "save" file to a SAS data set. (See Introduction for more information about the BMDP engine.) You can use the BMDP procedure any number of times in a SAS job to invoke BMDP.

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, but they are optional. The BMDP control statements follow the PARMCARDS statement.


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, you can use the following statement:
proc bmdp prog=bmdp3s code=judges;

Then, the BMDP INPUT paragraph must contain the following sentence:

CODE='JUDGES'

CODE= usually is 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, include the CODE sentence in the BMDP INPUT paragraph to name the "save" file. To use the name of the SAS data set, specify that name in the BMDP INPUT paragraph. If you use a different name, it must match the name that is supplied in the CODE= option.

CONTENT=DATA | CORR | MEAN | FREQ
tells BMDP whether your SAS data set is a standard SAS data set (CONTENT=DATA) or whether it contains a correlation matrix (CORR), variable means (MEAN), or frequency counts (FREQ). You do not need to 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. Ensure 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.

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, and 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 that contain 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 want only 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, which is described next.  [cautionend]

UNIT=n
specifies the FORTRAN logical unit number for the BMDP "save" file that the BMDP procedure creates. The value 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, n defaults to 3 and FT03F001 is used as the fileref for the "save" file.

WRKSPCE=nn | PARM=nn
controls the allocation of a work space in BMDP. The WRKSPCE= or PARM= value is passed as a parameter to BMDP programs and corresponds to the WRKSPCE= feature in BMDP OS/390 cataloged procedures. The default value for nn is 30. If nn is less than 100, then its value represents kilobytes. If it is greater than 100, then its value represents bytes.


VAR Statement

VAR variables;

The VAR statement specifies which variables to use 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 variables;

Use the BY statement with the BMDP procedure to obtain separate analyses of observations in groups. The groups 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 the following:

If a BY statement is used, it is included in the BMDP printed output to distinguish the BY group output.

For more information about the BY statement, see SAS Language Reference: Dictionary.


PARMCARDS Statement

PARMCARDS;

The PARMCARDS statement indicates that the BMDP control language follows.


BMDP Control Statements

Put your BMDP control language statements after the PARMCARDS statement. These statements are similar for all BMDP programs; see the most current BMDP manual for information about their forms and functions.

The BMDP INPUT paragraph must include UNIT and CODE sentences. The values of these sentences must match the UNIT= and CODE= values that are given in the PROC BMDP statement. (If the PROC BMDP statement does not specify a UNIT= value, then use 3 as the UNIT= value in the BMDP statements.) Use the SAS data set name as the CODE value unless you have used the CODE= option in the PROC BMDP statement to specify a different name. 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 that contain missing values are excluded from the data set that is sent to the BMDP program.


Invoking BMDP Programs That Need FORTRAN Routines

Some BMDP programs, such as the programs 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

Here is an example of creating and converting a BMDP "save" file.

[1] data temp;
    input x y z;
    datalines;
    1 2 3
    4 5 6
    7 8 9
    10 11 12
   run;
[2] proc contents;
    title 'CONTENTS OF SAS DATA SET TO BE RUN 
       THROUGH BMDP1D';
   run;

[3] proc bmdp prog=bmdp1d unit=3;
    parmcards;
    /input unit=3. code='TEMP'.
    /print min.
    /save unit=4. code='NEW'. NEW.
    /end
    /finish
   run;

[4] libname ft04f001 bmdp;
[5] data _null_;
    set ft04f001.new;
    put _all_;
   run;

[6] proc contents data=ft04f001._all_;
   run;

[7] proc convert bmdp=ft04f001 out=xyz;

The numbered lines of code are explained here:

  1. This DATA step creates a SAS data set called TEMP.

  2. The CONTENTS procedure shows the descriptive information for the data set TEMP.

  3. PROC BMDP calls the BMDP program BMDP1D to analyze the data set TEMP.

    Note the BMDP program statements UNIT=3. and CODE='TEMP'. The results are stored in the BMDP "save" file, NEW.

    The word NEW must be in the SAVE paragraph. UNIT=nn should refer to the FTnnF001 fileref that was defined in your DD statement.

  4. The LIBNAME statement associates the libref FT04F001 with the BMDP engine so that SAS knows which engine to use to access the data.

  5. The DATA step reads the BMDP "save" file NEW, which was created in the previous PROC BMDP step. It uses the two-level name FT04F001.NEW to reference the file.

  6. The CONTENTS procedure prints the information regarding all members that reside in the FT04F001 file. The _ALL_ member name is a special member name for the BMDP engine; it causes PROC CONTENTS to process all BMDP members in the file.

  7. The CONVERT procedure converts the BMDP "save" file NEW to a SAS data set named XYZ. The NEW "save" file is on UNIT 4, that is, FT04F001.

The output from this SAS program is shown in NEW Save File Created from Data Set TEMP and Converted to SAS Data Set XYZ, Part 1 of 3.

NEW Save File Created from Data Set TEMP and Converted to SAS Data Set XYZ, Part 1 of 3
   1
                  CONTENTS OF SAS DATA SET TO BE RUN THROUGH BMDP1D
                                  The CONTENTS Procedure
   ...

              -----Alphabetic List of Variables and Attributes-----

                       #    Variable    Type    Len    Pos
                       -----------------------------------
                       1    X           Num       8      0
                       2    Y           Num       8      8
                       3    Z           Num       8     16
   ...

   PAGE   1  1D

   BMDP1D - SIMPLE DATA DESCRIPTION
   COPYRIGHT 1977, 1979, 1981, 1982, 1983, 1985, 1987, 1988, 1990
                    BY BMDP STATISTICAL SOFTWARE, INC.

          BMDP STATISTICAL SOFTWARE, INC.| BMDP STATISTICAL SOFTWARE
          1440 SEPULVEDA BLVD            | CORK TECHNOLOGY PARK, MODEL FARM RD
          LOS ANGELES, CA 90025 USA      | CORK, IRELAND
             PHONE (213) 479-7799        |    PHONE +353 21 542722
             FAX   (213) 312-0161        |    FAX   +353 21 542822
             TELEX 4972934 BMDP UI       |    TELEX 75659 SSWL EI

   VERSION: 1990    (IBM/OS)          DATE: APRIL 27, 1999  AT 14:27:43
    MANUAL: BMDP MANUAL VOL. 1 AND VOL. 2.
    DIGEST: BMDP USER'S DIGEST.
   UPDATES: STATE NEWS. IN THE PRINT PARAGRAPH FOR SUMMARY OF NEW FEATURES.

   PROGRAM INSTRUCTIONS

   /INPUT UNIT=3. CODE='TEMP'.
   /PRINT MIN.
   /SAVE UNIT=4. CODE='NEW'. NEW.
   /END

   PROBLEM TITLE IS
      APRIL 27, 1999      14:27:43

   NUMBER OF VARIABLES TO READ . . . . . . . . . .       3
   NUMBER OF VARIABLES ADDED BY TRANSFORMATIONS. .       0
   TOTAL NUMBER OF VARIABLES . . . . . . . . . . .       3
   CASE FREQUENCY VARIABLE . . . . . . . . . . . .
   CASE WEIGHT VARIABLE. . . . . . . . . . . . . .
   CASE LABELING VARIABLES . . . . . . . . . . . .
   NUMBER OF CASES TO READ . . . . . . . . . . . . TO END
   MISSING VALUES CHECKED BEFORE OR AFTER TRANS. . NEITHER
   BLANKS IN THE DATA ARE TREATED AS   . . . . . . MISSING
   INPUT UNIT NUMBER . . . . . . . . . . . . . . .       3
   REWIND INPUT UNIT PRIOR TO READING. . DATA. . .     YES
   NUMBER OF INTEGER WORDS OF MEMORY FOR STORAGE .  689662
   
   INPUT BMDP FILE
   CODE. . . IS     TEMP
   CONTENT . IS     DATA
   LABEL . . IS

   VARIABLES
        1 X           2 Y           3 Z

   VARIABLES TO BE USED
        1 X           2 Y           3 Z
     PRINT CASES CONTAINING VALUES LESS THAN THE STATED MINIMA.

   ------------------------------------------
   BMDP FILE IS BEING WRITTEN ON UNIT       4
   CODE. . . IS     NEW
   CONTENT . IS     DATA
   LABEL . . IS      APRIL 27, 1999         14:27:43

NEW Save File Created from Data Set TEMP and Converted to SAS Data Set XYZ, Part 2 of 3
   PAGE   2  1D  APRIL 27, 1999         14:27:43
   VARIABLES ARE
        1 X           2 Y           3 Z

   BMDP    FILE ON UNIT  4 HAS BEEN COMPLETED.
   ------------------------------------------
   NUMBER OF CASES WRITTEN TO FILE        4

   NUMBER OF CASES READ. . . . . . . . . . . . . .       4

    VARIABLE      TOTAL                STANDARD    ST.ERR   COEFF. OF   SMALLEST
    NO. NAME      FREQUENCY      MEAN  DEVIATION   OF MEAN  VARIATION   VALUE
                LARGEST
     Z-SCORE    VALUE   Z-SCORE    RANGE

      1 X             4         5.5000    3.8730    1.9365    .70418    1.0000
      -1.16     10.000    1.16     9.0000
      2 Y             4         6.5000    3.8730    1.9365    .59584    2.0000
      -1.16     11.000    1.16     9.0000
      3 Z             4         7.5000    3.8730    1.9365    .51640    3.0000
      -1.16     12.000    1.16     9.0000

   NUMBER OF INTEGER WORDS USED IN PRECEDING    PROBLEM     530
   CPU TIME USED      0.030 SECONDS

NEW Save File Created from Data Set TEMP and Converted to SAS Data Set XYZ, Part 3 of 3
   PAGE   3  1D

   BMDP1D - SIMPLE DATA DESCRIPTION
   COPYRIGHT 1977, 1979, 1981, 1982, 1983, 1985, 1987, 1988, 1990
                 BY BMDP STATISTICAL SOFTWARE, INC.

          BMDP STATISTICAL SOFTWARE, INC.| BMDP STATISTICAL SOFTWARE
          1440 SEPULVEDA BLVD            | CORK TECHNOLOGY PARK, MODEL FARM RD
          LOS ANGELES, CA 90025 USA      | CORK, IRELAND
             PHONE (213) 479-7799        |    PHONE +353 21 542722
             FAX   (213) 312-0161        |    FAX   +353 21 542822
             TELEX 4972934 BMDP UI       |    TELEX 75659 SSWL EI

   VERSION: 1990    (IBM/OS)          DATE: APRIL 27, 1999  AT 14:27:44

   PROGRAM INSTRUCTIONS

   /FINISH

   NO MORE CONTROL LANGUAGE.

   PROGRAM TERMINATED
   
                 CONTENTS OF SAS DATA SET TO BE RUN THROUGH BDMP1D

                                The CONTENTS Procedure

   Data Set Name: FT04F001.NEW                         Observations:         .
   Member Type:   DATA                                 Variables:            4
   Engine:        BMDP                                 Indexes:              0
   Created:       14:27 Monday, April 27, 1999         Observation Length:   16
   Last Modified: 14:27 Monday, April 27, 1999         Deleted Observations: 0
   Protection:                                         Compressed:           NO
   Data Set Type:                                      Sorted:               NO
   Label:


              -----Alphabetic List of Variables and Attributes-----

                       #    Variable    Type    Len    Pos
                       -----------------------------------
                       4    USE         Num       4     12
                       1    X           Num       4      0
                       2    Y           Num       4      4
                       3    Z           Num       4      8

                               -----Directory-----
               Libref:        FT04F001
               Engine:        BDMP
               Physical Name: SYS99117.T145548.RA000.BDMP90V8.R0120689

                                #  Name  Memtype
                                ----------------
                                1  NEW   DATA


Chapter Contents

Previous

Next

Top of Page

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