Chapter Contents

Previous

Next
SAS Component Language: Reference

Using Shared Data Environments

SCL lists support shared data environments. (Without a shared data environment, if you wanted an entry to pass data to many other entries, you had to pass the data explicitly in each CALL DISPLAY statement, or else you had to put the values in macro variables. However, macro variables are limited in the amount of data they can contain (only scalar values), and their names must be valid SAS names.) By placing data in a shared data environment, other programs and even other SAS applications can retrieve the data via a name. These names can be any valid SCL string, and the value associated with a name can be a numeric value, a character value, or an entire list.

The two kinds of shared data environments are implemented with local SCL lists and global SCL lists.


Local Data Environment

Each SAS software application (such as an FSEDIT application, or a SAS/AF application started with the AF command) maintains its own application environment in a local environment list. You can store information that is local to the application, but which you want to be shared among all of an application's entries, in this local environment list. The function ENVLIST('L') returns the list identifier of the environment list for the current application. Other applications' lists are maintained in the memory of each application, and even though two lists in different applications may have the same list identifier, the lists are actually different. This is analogous to the same SAS table identifier being used by different SAS applications: the identifier actually refers to different SAS tables that are opened at different times.


Global Data Environment

There is also a global environment list that stores data that can be shared across all SAS applications started in the same SAS session or process. For example, one SAS application may place some data in the global environment list and then close. Another application may then open and read the data that was created by the first application. To access the global environment list, use the list identifier returned by ENVLIST('G').


Chapter Contents

Previous

Next

Top of Page

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