Chapter Contents

Previous

Next
SAS Companion for the OpenVMS Operating Environment

Using the OSIRIS and SPSS Engines

The following read-only engines enable you to access files that were created with other vendors' software as if those files were written by the SAS System:
OSIRIS accesses OSIRIS files.
SPSS accesses SPSS files that were created under Release 9 of SPSS as well as SPSS-X system files and portable files.

You can use these engines in any SAS applications or procedures that do not require random access. For example, by using one of the engines with the CONTENTS procedure and its _ALL_ option, you can determine the contents of an entire SPSS file at once.


Restrictions on the Use of These Engines

Because these are sequential engines, they cannot be used with the POINT= option of the SET statement or with the FSBROWSE, FSEDIT, or FSVIEW procedures in SAS/FSP software. However, you can use the COPY procedure, the DATASETS procedure, or a DATA step to copy an OSIRIS or SPSS file to a SAS data set, and then use either POINT= or SAS/FSP to browse or edit the file. Also, some procedures (such as the PRINT procedure) issue a warning message indicating that the engine is sequential.


Accessing OSIRIS Files

Although OSIRIS runs only under OS/390 (formerly MVS) and CMS, the SAS OSIRIS engine accepts an OS/390 data dictionary from any other operating environment that is running the SAS System. The layout of an OSIRIS data dictionary is the same on all operating environments. The data dictionary and data files should not be converted between EBCDIC and ASCII, however, because the OSIRIS engine expects EBCDIC data.

Assigning a Libref to an OSIRIS File

In order to access an OSIRIS file, you must use the LIBNAME statement or LIBNAME function to assign a libref to the file. (Alternately, you can select Default as the type in the Engine: field of the New Library dialog box.) Specify the OSIRIS engine in the LIBNAME statement as follows:

LIBNAME libref OSIRIS 'data-filename'
DICT= 'dictionary-filename';
where

libref
is a SAS libref.

OSIRIS
is the OSIRIS engine.

data-filename
is the physical name of the data file.

dictionary-filename
is the physical filename of the dictionary file. The dictionary filename can also be a fileref or an OpenVMS logical name. However, if you use a fileref or an OpenVMS logical name for the dictionary-filename, do not use quotation marks.

You do not need to use a LIBNAME statement before running the CONVERT procedure if you are using PROC CONVERT to convert an OSIRIS file to a SAS data file. (For more information, see the procedure CONVERT.)

Note that the LIBNAME statement has no engine/host options for the SPSS engine.

If you previously assigned a fileref or an OpenVMS logical name to the OSIRIS file, then you can omit the data-filename in the LIBNAME statement. However, you must still use the DICT= option, because the engine requires both files. (For details, see Example: Accessing OSIRIS Files.)

You can use the same dictionary file with different data files. Enter a separate LIBNAME statement for each data file.

Referencing OSIRIS Files

OSIRIS data files do not have individual names. Therefore, for these files you can use a member name of your choice in SAS programs. You can also use the member name _FIRST_ for an OSIRIS file.

Under OSIRIS, the contents of the dictionary file determine the file layout of the data file. A data file has no other specific layout.

You can use a dictionary file with an OSIRIS data file only if the data file conforms to the format that the dictionary file describes. Generally, each data file should have its own DICT file.

Example: Accessing OSIRIS Files

Suppose you want to read the OSIRIS data file TEST1.DAT, and the dictionary file is TEST1.DIC. The following statements assign a libref to the data file and then run PROC CONTENTS and PROC PRINT on the file:

libname mylib osiris 'test1.dat' dict='test1.dic';
proc contents data=mylib._first_;
run;

proc print data=mylib._first_;
run;


Accessing SPSS Files

The SPSS engine supports portable file formats for both SPSS and SPSS-X files. The engine automatically determines which type of SPSS file it is reading and reads the file accordingly.

This engine can read only SPSS data files that were created under the same operating environment. For example, the SPSS engine under OpenVMS cannot read SPSS files that were created under the OS/390 operating environment. The only exception is an SPSS portable file, which can originate from any operating environment.

Assigning a Libref to an SPSS File

In order to access an SPSS file, you must use the LIBNAME statement or LIBNAME function to assign a libref to the file. (Alternately, you can select Default as the type in the Engine: field of the New Library dialog box.) Specify the SPSS engine in the LIBNAME statement as follows:

LIBNAME libref SPSS 'filename';
where

libref
is a SAS libref.

SPSS
is the SPSS engine.

file-specification
is the physical filename.

You do not need to use a LIBNAME statement before running the CONVERT procedure if you are using PROC CONVERT to convert an SPSS file to a SAS data file. (For more information, see the procedure CONVERT.)

Note that the LIBNAME statement has no engine/host options for the SPSS engine.

If you previously assigned a fileref or an OpenVMS logical name to the SPSS file, then you can omit the file-specification in the LIBNAME statement. SAS uses the physical filename that is associated with the fileref or logical name. (For details, see Example: Accessing SPSS Files.)

Referencing SPSS Files

SPSS data files do not have names. For these files, use a member name of your choice in SAS programs.

SPSS data files have only one logical member per file. Therefore, you can use _FIRST_ in your SAS programs to refer to the first data file.

Example: Accessing SPSS Files

Suppose you want to read the SPSS file MYSPSSX.DAT. The following statements assign a libref to the file and then run PROC CONTENTS and PROC PRINT on the file:

libname mylib spss 'myspssx.dat';
proc contents data=mylib._first_;
run;

proc print data=mylib._first_;
run;


Chapter Contents

Previous

Next

Top of Page

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