Chapter Contents

Previous

Next
envname

envname



Get Subenvironment Name

Portability: SAS/C extension


SYNOPSIS
DESCRIPTION
RETURN VALUE
CAUTION
EXAMPLE


SYNOPSIS

#include <lclib.h>

char *envname(void);


DESCRIPTION

envname gets the subenvironment name stored in bytes 14 through 21 of the environment descriptor block.


RETURN VALUE

envname returns a pointer to the string containing the subenvironment name. Under OS/390, if the program is running under TSO, envname returns either "TSO" or "TSO/E" . Under CMS, envname returns "CMS" . For a UNIX System Services (USS)child process, or a program called with exec -linkage, envname returns "OpenMVS" , even if invoked under TSO.

If no special subenvironment is active, envname returns the same information as sysname .


CAUTION

See "Caution" under The L$UENVR Routine.


EXAMPLE

#include <lclib.h>
#include <stdlib.h>
#include <lcstring.h>

   if (memcmp(envname(), "TSO", 3) == 0)
      system("TSO: DELETE TEMP.FILE");
   else if (memcmp(envname(),"CMS", 3) == 0)
      system("CMS: ERASE TEMP FILE A");
   else if (memcmp(envname(), "OpenMVS", 7) == 0)
      system("sh: rm temp.file");
   .
   .
   .

envname is also illustrated in the example for envlevel .


Chapter Contents

Previous

Next

Top of Page

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