Published on :
Macro INTERNAL_CREATION

AHGuncompress Macro - Character Retention

This code is also available in: Deutsch Español Français
This macro implements a 'Keep' logic using two nested COMPRESS functions. The internal compression removes desired characters from the source string to isolate unwanted characters. The external compression then uses this result to remove these unwanted characters from the source string, leaving only the target characters.
Data Analysis

Type : INTERNAL_CREATION


Purely functional operation on character strings, no dependency on external data.

1 Code Block
MACRO
Explanation :
Definition of the macro taking a target string (string) and characters to keep (char) as input. It returns the filtered string.
Copied!
1%macro AHGuncompress(string,char);
2%sysfunc(compress(&string,%sysfunc(compress(&string,&char)) ))
3%mend;
4 
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.