Chapter Contents


SAS Companion for the OS/390 Environment

Accessing BMDP Files

The BMDP engine can read only BMDP "save" files that were created on the same operating environment. For example, the BMDP engine under OS/390 cannot read BMDP files that were created under the OpenVMS operating environment.

Assigning a Libref to a BMDP File

In order to access a BMDP file, you must use the LIBNAME statement or LIBNAME function to assign a libref to the file.

You do not need to use a LIBNAME statement or function before running PROC CONVERT if you are using PROC CONVERT to convert a BMDP file to a SAS data file. (See CONVERT.)

Note that the LIBNAME statement has no options for the BMDP engine.

If you previously used a TSO ALLOC command or a JCL DD statement to assign a DDname to the BMDP file, you can omit the physical-filename (a physical file name in the OS/390 operating environment) in the LIBNAME statement or LIBNAME function and use the DDname as the libref. See Accessing BMDP Files.

For information on the LIBNAME statement, see LIBNAME. For information on the LIBNAME function, see LIBNAME.

Referencing BMDP Files

Because there can be multiple "save" files in a single physical BMDP file, you use the value of the BMDP CODE= argument as the name of the SAS data file. For example, if the BMDP "save" file contains CODE=ABC and CODE=DEF, and if the libref is XXX, you reference the files as XXX.ABC and XXX.DEF. All BMDP CONTENT types are treated the same, so even if file DEF has CONTENT=CORR under BMDP, SAS treats it as CONTENT=DATA.

In your SAS program, if you want to access the first BMDP "save" file in the physical file, or if there is only one "save" file, you can refer to the file as _FIRST_. This approach is convenient if you do not know the BMDP CODE= name.

Examples of Accessing BMDP Files

Suppose the physical file MY.BMDP.FILE contains the "save" file ABC. The following statements assign a libref to the data set and then run PROC CONTENTS and PROC PRINT on the BMDP file:

libname xxx bmdp 'my.bmdp.file';
proc contents;
proc print;

In the next example, the TSO ALLOC command associates a DDname with the name of the physical file that comprises the BMDP physical-filename. The physical file name is omitted in the LIBNAME statement and LIBNAME function, because the libref that is used is the same as the DDname in the TSO statement. The PROC PRINT statement prints the data for the first "save" file in the physical file.

tso alloc f(xxx) da('my.bmdp.file') shr reu;
libname xxx bmdp;
proc print data=xxx._first_;

Chapter Contents



Top of Page

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