Troubleshooting
Problem
The "direct" command receives XCLC001I Missing CLI environment variable. (7.0.8394136.2500723)
Symptom
XCLC001I
Error: Missing CLI environment variable NDMAPICFG.
XAPC001I
Error: "Missing API environment variable NDMAPICFG. The
NDMAPICFG environment variable must be set before calling the API.
Error:
Failed to read configuration file, exiting.
Error: Missing CLI
environment variable. CONNECT:Direct CLI Terminated.
Cause
The NDMAPICFG environment variable must be set in a user's environment before
the CONNECT:DIRECT "direct" CLI command is issued to connect to the Direct
server. The error can also occur if running a C-program (C++ not supported),
that uses our Direct API function calls.
The automation id was using a
different shell environment than the environment variable was being set for
Configuration file, userfile.cfg is missing.
Resolving The Problem
If function call "ndmapi_connect" is coded without specifying the parameter values for "ndm_hostname" and "ndm_portname" then Direct will do a search to resolve these values. The second step in that search will be to get the values from parameters in the file "ndmapi.cfg". Reading this file Connect:Direct expects the environment variable NDMAPICFG to be set and if not this error occurs. The "ndmapi_connect" function call with parameters "ndm_hostname" and "ndm_portname" are documented in the Connect:Direct UNIX User's Guide.
There is also an example of how to code this function call in a sample C-program supplied with Direct UNIX in the file "/d_dir/ndm/src/apicheck.c". See the Connect:Direct Getting Started Guide or see the Connect:Direct UNIX Installation and Administration Guide or set the NDMAPICFG variable in the user's environment as follows: For UNIX userid's running under the following UNIX shells issue the following UNIX commands: BOURNE or KORN SHELLS (bsh/ksh) "NDMAPICFG=/d_dir/ndm/cfg/cliapi/ndmapi.cfg <ENTER>" "export NDMAPICFG <ENTER>" C-SHELL (csh) "setenv NDMAPICFG /d_dir/ndm/cfg/cliapi/ndmapi.cfg <ENTER>" This environment variable can also be setup in the user's environment by putting the previous commands in the user's ".profile" file for the bourne or korn shell and in the ".login" file for the C-Shell. This ensures the variable gets set in the user's environment each time they log into the UNIX system.
Manually create userfile.cfg file
Historical Number
PRI79
Product Synonym
[<p><b>]Fact[</b><p>];Connect:Direct for UNIX;all Releases. [<br/>] 7.0.8394136.2500723 [<br/>] ;CONNECT:Direct UNIX;all versions [<br/>] SCI12523
Was this topic helpful?
Document Information
Modified date:
17 December 2019
UID
swg21520443