BEGINLIBPATH/ENDLIBPATH

You cannot use the "environment variables" BEGINLIBPATH and ENDLIBPATH (OS/2 Version 3.0 and above) in a REXX program because these are not real environment variables.
Statements like

 
  say "  BeginLibPath=<" || value( "BEGINLIBPATH " ,, "OS2ENVIRONMENT") || ">"
  say "    EndLibPath=<" || value( "ENDLIBPATH "   ,, "OS2ENVIRONMENT") || ">"

will always return

 
  BeginLibPath=<>
  EndLibPath=<>

To set the "variable" BEGINLIBPATH in a REXX program you must use the OS/2 command SET:

 
  "SET BEGINLIBPATH=C:\MYLIBS"

If you try to modify BEGINLIBPATH/ENDLIBPATH with the SET command AND with the REXX function VALUE at the same time, OS/2 produces a strange result:

It creates two variables, both named BEGINLIBPATH (The correct variable is the variable with the blanks before and after the equal sign.).
The environment variable BEGINLIBPATH set with the REXX function VALUE is only accessible with %BEGINLIBPATH% - the REXX function VALUE can&t read the environment variable.
To equalize this the CMD.EXE can't read the "variable" set with the SET command anymore if there's an environment variable set with the REXX function VALUE.

By the way: If you want to use the value of the "variable" BEGINLIBPATH set with the SET command in other OS/2 commands with %BEGINLIBPATH% you must write the name complete in uppercase. But, of course, there's also an exception to this rule:
If you want to change the variable BEGINLIBPATH with a command like SET BEGINLIBPATH=%BEGINLIBPATH%;C:\newPart you can write BEGINLIBPATH in lowercase or mixed case also.