Published on :
Général INTERNAL_CREATION

Sans titre

This code is also available in: Deutsch Español Français
This macro is probably part of a test framework (FUTS). It checks if a given fileref exists using the `%fexist` function. If the fileref is missing (returns 0), the macro calls `%generate_event` to signal the anomaly with configurable details (message, level, type, etc.) and can potentially stop execution via the ABORT parameter. It also increments a global test counter `futs_tst_cnt`.
Data Analysis

Type : INTERNAL_CREATION


The macro does not access tabular data. It interacts with the file system via filerefs and manipulates macro variable counters.

1 Code Block
Macro
Explanation :
Macro definition. 1) Incrementing the test counter `futs_tst_cnt`. 2) Checking for the existence of the fileref passed as a parameter via `%fexist`. 3) If the fileref does not exist, calling the `%generate_event` macro to handle the error/test failure.
Copied!
1%macro assert_fexist( FILEREF,
2 MESSAGE=Fileref &FILEREF does not exist,
3 TYPE=,
4 LEVEL=,
5 ATTACHDATA=,
6 ATTACHFILE=,
7 METRIC=,
8 PROPERTIES=,
9 ON_EVENT=,
10 DESCRIPTION=, ABORT= );
11 
12%let futs_tst_cnt = %eval(&futs_tst_cnt.+1);
13 
14%IF %fexist(&FILEREF) eq 0 %THEN
15 %generate_event(TYPE=&TYPE, LEVEL=&LEVEL,
16 MESSAGE=&MESSAGE,
17 ATTACHDATA=&ATTACHDATA, ATTACHFILE=&ATTACHFILE,
18 METRIC=&METRIC,
19 PROPERTIES=&PROPERTIES,
20 ON_EVENT=&ON_EVENT,
21 DESCRIPTION=&DESCRIPTION, ABORT=&ABORT);
22 
23%mend assert_fexist;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : Modified FUTS v1.1 Copyright (c) 2015 John Jacobs. All rights reserved.