I want to know if it is possible to create a custom format that will work on a range of character values by taking a substring and formatting it base on that.
e.g. A001, B001, C001 are all formatted to 'JAN' A002, B002, C002 are all formatted to 'FEB'
Is this possible?
value $custom_format'A001', 'B001', 'C001' = 'JAN'
'A002', 'B002', 'C002' = 'FEB';
etc.
I know you can just list specific character values you want formatted (as above), but I would like this to work for any letter at the begining and only read the last 3 characters to determin the format, without having to list all possible iterations.
Use
substrto only pull the last 3 values and create a format based on that.Output:
If you need something more complex, you can supply regex to formats in SAS.