10-23-2017 01:03 PM
I'm attemptine to merge several variables together and create a new merged variable for plotting. The simple concept is below.
merge varr1 var2 ... into varnew;
proc sgplot data=have;
10-23-2017 01:10 PM
merging data sets uses a MERGE statement.
If you're trying to combine variables use a CAT type formula.
CATX() will concatenate variables with a delimiter, CATT() is another option.
10-23-2017 01:45 PM
Thanks for the quickk reply. Using the following code it does not seem to merge.
merge var1 var2 var3;
How does the merge happen and where does it go? This should be a trivial operation. I need to merge/combine multiple variables of the same format and equal length for vbar plotting.
Also, I'm not clear on why the CAT's need to be used..
10-23-2017 02:06 PM
It is trivial, I don't think you understand the MERGE statement. It's intended to merge DATA SETS not variables.
Post sample data if you need further assistance. CAT will combine variables into a single variable, which is what you seem to want. But it may not be the case, which is why you need to post data if you need further help.
new_variable= catt(var1, var2, var3);
10-23-2017 02:12 PM
The input columns look like the below:
The desired output looks like
I hope this is clearer.
Need further help from the community? Please ask a new question.