Type : CREATION_INTERNE
Le script ne lit aucune donnée externe. Il crée une fonction personnalisée ('year_of_birth') à l'aide de la procédure PROC FCMP, qui est ensuite utilisée comme cible pour les tests.
| 1 | %* Example 1: Show help information: ; |
| 2 | %m_utl_chk_func_exist(?) |
| 1 | %* For the next examples create a function library and functions: ; |
| 2 | options cmplib=WORK.functs; |
| 3 |
| 1 | PROC FCMP outlib=WORK.functs.examples; |
| 2 | function year_of_birth(age); |
| 3 | birth_year = year(date())-age; |
| 4 | return(birth_year); |
| 5 | endsub; |
| 6 | QUIT; |
| 1 | %* Example 2: check IF the function Day_of_Birth exists (RESULT=0): ; |
| 2 | %let function_exist = |
| 3 | %m_utl_chk_func_exist( |
| 4 | fname = Day_of_Birth |
| 5 | , flib = WORK.functs |
| 6 | , debug = Y |
| 7 | ); |
| 8 | |
| 9 | %put &=function_exist.; |
| 1 | %* Example 3: check IF the function Month_of_Birth exists (RESULT=0): ; |
| 2 | %m_utl_chk_func_exist( |
| 3 | fname = Month_of_birth |
| 4 | , flib = WORK.functs |
| 5 | , global_flg = Y |
| 6 | , mvar_match = func_exist |
| 7 | , debug = Y |
| 8 | ); |
| 9 | |
| 10 | %put &=func_exist.; |
| 1 | %* Example 4: check IF the function Year_of_Birth exists (RESULT=1): ; |
| 2 | %m_utl_chk_func_exist( |
| 3 | function = Year_of_birth |
| 4 | , library = WORK.functs |
| 5 | , global_flg = Y |
| 6 | , mvar_match = func_exist |
| 7 | , debug = Y |
| 8 | ); |
| 9 | |
| 10 | %put &=func_exist.; |