Published on :
Macro CREATION_INTERNE

AHG Utility Macros for String Manipulation

This code is also available in: Deutsch Español Français
The script defines three macros. 'AHGstartwith' checks if a string starts with a given substring using a third-party macro '%ahgpos'. 'AHGtestANDcut' seems to initiate a condition based on 'AHGstartwith' but contains no action (empty code after %then). 'AHGmask' initializes local variables, uppercases arguments, and initiates an iterative loop based on a third-party macro '%AHGcount', but the loop body is empty.
Data Analysis

Type : CREATION_INTERNE


Purely macro processing, no external data source is read.

1 Code Block
MACRO
Explanation :
Functional macro returning 1 if the 'word' variable starts with 'leadstr', and 0 otherwise. It relies on an external macro '%ahgpos'.
Copied!
1%macro AHGstartwith(word,leadstr);
2 %IF %ahgpos(&word,&leadstr)=1 %THEN 1;
3 %ELSE 0;
4%mend;
2 Code Block
MACRO
Explanation :
Structural macro that checks if 'word' starts with 'leadstr'. The current code contains no instructions after the condition (null instruction), suggesting an incomplete implementation.
Copied!
1%macro AHGtestANDcut(word,leadstr);
2%IF %AHGstartwith(&word,&leadstr) %THEN ;
3 
4%mend;
5 
3 Code Block
MACRO
Explanation :
Macro draft to apply a mask. It prepares variables (uppercasing) and configures an iterative loop based on the number of elements in 'mask' (delimited by ':'), calculated by the external macro '%AHGcount'. The loop body is empty.
Copied!
1%macro AHGmask(word,mask);
2 %local i item;
3 %let mask=%upcase(&mask);
4/* %let mask=%sysfunc(&mask,);*/
5 %let word=%upcase(&word);
6 %DO i=1 %to %AHGcount(&mask,dlm=:);
7
8 %END;
9%mend;
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.