Desktop productivity for business analysts and programmers

Update Column Labels

Reply
N/A
Posts: 0

Update Column Labels

Hi,

Column names in our set-up have been designed to allow process flows to continue to function when the data is updated, with labels overlaid to clarify the content. The specific example is with years, where the column name is changed to Ym where is an integer which indicates the year as (current year minus ); the label would be overlaid as the specific year e.g. 2009.

However when the data is updated and the column label changes EG doesn't reflect that, so the label remains as the previous year which could be confusing. Is there some way to overcome that, either an option which would force EG to update to the latest labels in input data or a way of dynamically assigning column labels using metadata.

Thanks, Chris
Respected Advisor
Posts: 3,825

Re: Update Column Labels

Hi Chris

As I understand this you're changing the labels in the physical SAS data set BUT you have this data set also registered as SAS Metadata.

Now EG shows the metadata column definitions which of course aren't updated.

You could either update the metadata using SMC's update function (manual intervention), you could write a piece of code which alters the metadata definition accordingly to the physical data set (I wouldn't recommend it as there is the danger to mess up metadata), or you could not register the tables at all in the metadata so that EG shows the physical definitions from the very beginning.

I'm not aware of an option which can be set in the metadata for a specific library or even a DS in a library to not pick up the metadata definition (if the table is registered).

If the table must be defined in the metadata for some other processing then of course you have always the option to define a second library pointing to the same physical location and there you don't register the tables.

I believe what also could work is to overwrite the libref as set in metadata with a libname statement in the autoexec. I would expect that EG then shows the physical table definitions (needs to be tested).

HTH
Patrick
N/A
Posts: 0

Re: Update Column Labels

Hi Patrick, thanks for the information.

I believe the metadata is updated in SMC each time the data is refreshed. Looking at the dataset in EG shows the correct labels and creating a new Filter and Query node uses the correct labels, but an existing one won't update to the new labels. It appears that the node picks up the labels from the input dataset and applies them to the output dataset when the task is created and then fixes them.

Regards, Chris
Respected Advisor
Posts: 3,825

Re: Update Column Labels

Hi Chris

That an EG node isn't updated automatically makes kind of sense to me.

May be the concept of using variable labels to store information about the data needs some re-thinking.

If there are already a lot of EG projects / permanent output data sets having this issue then the only thing I can think of right now would be to implement some kind of post processing these data sets - i.e. an additional manually coded node where the labels of the source ds are read and then applied to the target ds.

HTH
Patrick
Ask a Question
Discussion stats
  • 3 replies
  • 150 views
  • 0 likes
  • 2 in conversation