Chapter Contents |
Previous |
Next |
Moving and Accessing SAS Files across Operating Environments |
Because the smallest numeric variable that can be represented on the OpenVMS systems are different from each other (VAX, 2 bytes; Alpha, 3 bytes) numeric variables in OpenVMS VAX SAS files must be increased to 3 bytes before the files can be used by the Alpha systems.
Use PROC CONTENTS or PROC DATASETS with the CONTENTS statement to verify the size of a data file's smallest numeric variables.
After you have determined that the VAX environment contains numeric variables that are 2 bytes long, you can use either of two SAS procedures to increase the OpenVMS VAX SAS variables to 3 bytes. One procedure is for data sets and catalogs; the other is for data sets only.
Using PROC CPORT for Data Sets and Catalogs |
For both data sets and catalogs, at the source system, use PROC CPORT to create transport files.
At the target system, use PROC CIMPORT with the option and value EXTENDSN=YES. Here is an example.
filename tranfile 'SAS-data-library'; libname grades 'SAS-data-library'; proc cimport library=grades file=tranfile EXTENDSN=YES;
At the Alpha system, a numeric variable whose length is less than 8 bytes is automatically increased by 1 byte. Not only is a 2-byte variable increased to 3 bytes but so is a 5-byte variable increased to 6 bytes.
The advantage of this method is that PROC CPORT and PROC CIMPORT can be used to transport both data sets and catalogs. The disadvantages are that two systems are needed to perform the transfer and extra memory is used for storing 1 additional byte for each variable whose length is between 2 and 8, inclusive.
Using PROC VAXTOAXP for Data Sets Only |
Here is an example of using PROC VAXTOAXP:
libname vlib v6 'user$disk:[dir]'; libname alib v8 '[nwdir]'; proc vaxtoaxp data=vlib.grades out=alib.grades; run;The Version 6 and Version8 behaviors of this procedure are different. In Version 6, this procedure is restricted to 2-byte variables only. For example, it does not increase a 5-byte variable to a 6-byte variable. However, in Version 8, this procedure does support a range of 2- to 7-byte variables. For example, the procedure increases a 7-byte variable to 8 bytes.
The limitation of this method is that PROC VAXTOAXP operates on only one data set at a time. For details about PROC VAXTOAXP, see SAS Companion for the OpenVMS Operating Environment.
However, as an alternative, you can use the SAS macro language to write instructions to process automatically an entire library of data sets. For details, see SAS Macro Language: Reference.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.