The purpose of CATXF would be to concatenate formatted values with a delimiter.
CATXF(format, delimiter, item-1 <, ... item-n>)
If format is not present use the variables format attribute.
A null delimiter would be a null delimiter (not an implicit 1-space)
array items (5) _temporary_ (1:5);
result = catxf(z4., '', of items(*));
I like this idea - great for creating fixed format raw data, among other benefits.
I especially the proposal that the absence of a format tells SAS to use the format attribute, which would be a VERY handy way to concatenate mixed formats.
I feel like this might be something that could be added to CATQ, at minimum, given it already takes a modifier. Of course we don't always want the quoting, but most of the time it either is helpful or more often won't actually happen in practice, and if that meant this was easier to add (adding a whole function might be much harder than adding functionality to a function?), I'd be all for it. Worst case could always remove quotes later, right?
Richard ( @RichardDeVen ),
It looks like SAS didn't catch the idea, but I did (some time ago but forgot to replay).
Let me know what do you think:
All the best
Just a note on your example. You have NOT provided a NULL delimiter in your function call. Just typing two quotes next to each other does NOT make a null value in SAS syntax, it makes an empty character string of length 1. So a single space character.
So either change you function call to one of these:
result = catxf(z4., , of items(*));
result = catxf(z4., trimn(' '), of items(*));
Or change the results produced by your example to reflect the values passed in the function call:
0001 0002 0003 0004 0005
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.