I'm developing an EG 4.1 Add-In using VB.Net. I'm currently using SASVariableSelector.GetAssignedVariable(ROLE,n) to extract the name of a variable in a Role list. Is there a method or property I can use to extract the label of that variable, instead of the name?
You can use the ISASTaskData and ISASTaskDataColumn interfaces to get this information.
Here is a C# snippet that should translate to VB.NET fairly easily.
ISASTaskData data = Consumer.ActiveData;
ISASTaskDataAccessor da = data.Accessor;
// to do that, we need to "open" the data to get a peek at the column
for (int i=0; i < da.ColumnCount; i++)
ISASTaskDataColumn ci = da.ColumnInfoByIndex(i);
I found something similar to your code in the Compare Add-In code in the VB.Net Samples. Unfortunately, although it works very well when picking up the labels from the underlying data set, if I've changed the label or format in the SAS Variable Selector object, it ignores those changes.
Is there any interface to the SAS Variable Selector object that can give me the changed label or format? If there isn't anything suitable, I might try to include user-editable labels and formats in the SAS Variable Properties object instead.