![]() |
PING
0.9
Statistical data handling and processing in production environment
|
dsn : a dataset reference;lib : (option) name of the input library; by default: empty, i.e. WORK is used.ans : (option) the error code of the test, i.e.:
-1 when the library does not exist,0 if the dataset exists,1 (error: "dsn does not exist") otherwise.should not be used contemporaneously with the option _dslst_ below;
_dslst_ : (option) name of the macro variable used to store the elements from var that actually define existing variables/fields in dsn; incompatible with returned result ans above.Let us consider a non-empty dataset:
returns ans=0. Let us then generate some datasets in WORKing directory:
we can then also use the macro to retrieve those elements in a given list that actually correspond to existing datasets in WORK:
returns ods=_dstest1 _dstest2 _dstest5.
Run macro %_example_ds_check for examples.
ans to the test when a result shall be returned (and _dslst_ is not passed), or an updated list of acceptable datasets (when _dslst_ is passed). The former case is useful when testing a single dataset existence in a library, the latter for triming a list of actual datasets. Contemporaneous use is impossible._dslst_ is not passed) is the evaluation of:dsn.dsn matches a dataset in lib, an empty list is set.