PING  0.9
Statistical data handling and processing in production environment
lib_check

Check the existence of a library.

%let ans=%lib_check(lib);

Argument

lib : library reference.

Returns

ans : the error code of the test, i.e.:

  • 0 if the library reference exists,
  • > 0 (error: "lib does not exist") if the library reference does not exist,
  • < 0 (error) if the library reference exists, but the pathname is in question.

The latter case can happen when a LIBNAME statement is provided a non-existent pathname or the physical path has been removed, the library reference will exist, but it will not actually point to anything.

Note

In short, the error code returned is the evaluation of:

%sysfunc(libref(&lib));

Reference

Johnson, J. (2010): "OBJECT_EXIST: A macro to check if a specified object exists".

See also

%ds_check, %dir_check, %file_check.