skip to main content

Library Routines : C$LIST_ENVIRONMENT

C$LIST_ENVIRONMENT
The C$LIST_ENVIRONMENT library routine provides a number of functions to retrieve a list of Framework properties that are currently set in the environment.
Syntax:
 CALL "C$LIST_ENVIRONMENT" USING opCode 
Parameters:
Return code:
returnCode definition and meaning depend on the opcode.
Examples:
Example - The following program displays on the system output the list of all environment variables currently set.
       PROGRAM-ID. listenv.
       WORKING-STORAGE SECTION.
       copy "iscobol.def".
       77 variableName  pic x any length.
       77 variableValue pic x any length.
       77 listenvHandle usage handle.
       PROCEDURE DIVISION.
           CALL "C$LIST-ENVIRONMENT" using LISTENV-OPEN
           if listenvHandle not = 0
              perform until exit
                 CALL "C$LIST-ENVIRONMENT" using LISTENV-NEXT
                 if variableName = spaces
                 else                                 
                    CALL "C$GETENV" using variableName, variableValue
                    display variableName "=" variableValue upon sysout
              CALL "C$LIST-ENVIRONMENT" using LISTENV-CLOSE, 

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left