Chapter Contents

Previous

Next
Getting Environmental Information

The L$UENVR Routine

L$UENVR is a routine called by the SAS/C Library as part of initialization every time the main function of a C program executes. L$UENVR returns information about the operating system and the current environment.

This description of L$UENVR has two objectives:


L$UENVR Source Code

A sample version of L$UENVR source code is provided on the installation tape (in member L$UENVR).(footnote 1) This sample returns information about the standard systems (OS/390 and CMS) under which the compiler runs. The sample is included so that L$UENVR can be modified by a site to indicate special environments. Comments in the code describe how to make any necessary modifications.

Your site normally does not need to change L$UENVR unless you are running programs in a nonstandard environment. For example, changes in the L$UENVR source code are needed to run C programs under a system (such as ROSCOE) that is different from the systems for which the compiler was developed. Note that the operation of the library in such special environments is not guaranteed, but if the environment resembles a normal OS/390 or CMS environment closely enough, execution is possible.


Environment Descriptor Block

The L$UENVR routine stores information about the operating system in an environment descriptor block. L$UENVR is called using standard IBM linkage. Register 1 addresses an area in which the environment descriptor block will be built. (This block is mapped by the ENVDB DSECT, which is present in the sample macro library.) Fifty-six bytes that can be used for work space follow the standard 72-byte save area addressed by register 13.

The environment descriptor block is 48 bytes and contains the information shown in the following table.

Environment Descriptor Block
Offset (decimal) Length (bytes) Description
0 2 halfword length of the block (48) (decimal)
2 8 environment name (blank padded), for example, MVS/SP, VM/SP
10 1 environment version number (integer)
11 1 environment release number (integer)
12 1 environment modification level (integer)
13 1 submodification level, if appropriate
14 8 subenvironment name, if applicable; for example, TSO-a subenvironment of OS/390
22 1 subenvironment version number (integer)
23 1 subenvironment release number (integer)
24 1 subenvironment modification level (integer)
25 1 subenvironment submodification level
26 1 environment number (see ENVDBDSECT for codes)
27 1 supported function flags. These flags are set by L$UENVR to show whether specific functions ae available.
28 1 XA support flags x'80' = XA architecture, x'40' = PSW in XA format
29 1 time sharing flags x'80' = program executing interactively
30 1 system function flags: x'80' = dynamic allocation supported

x'40' = SPIE or ESPIE supported

x'20' = ESTAE or ABNEXIT

31 18 reserved

Any undefined or meaningless items in the environment descriptor block should be stored as 0 s. If you modify L$UENVR, a new set of information is created for the special environment in which compiled programs will run.

Note:    If you modify L$UENVR, do not change the information in the descriptor block for the standard systems (OS/390 and CMS) because the library may malfunction.  [cautionend]


Caution

The information may be unavailable or incorrect unless the L$UENVR source code is examined and changed as necessary by a systems programmer familiar with the local operating systems.

Local operating system conventions or modifications may cause these functions to return incorrect or misleading values. Contact your SAS Software Representative for C Compiler products to confirm that L$UENVR provides the information required.


FOOTNOTE 1:   See your SAS Software Representative for SAS/C software products for the location of this member. [arrow]


Chapter Contents

Previous

Next

Top of Page

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