05-19-2016 07:29 AM - edited 05-19-2016 07:33 AM
My organization is running EG 7.1 on SAS 9.4 and uses Query Builder extensively. Occassionally, we will receive an error (in apop up / dialog box) that reads...
"Item has already been added. Key in dictionary: 'ColumnName' Key being added: 'ColumnName'"
Where ColumnName is the name of a calculated column created in that query node.
The error prevents you from editing the query BUT still allows you to run the query and it successfully builds a table.
The calculated column in particular is just a simple TRIM statement.
/* ItemOrig */ (TRIM(t2.'Item#'n)) LABEL="ItemOrig" AS ItemOrig,
One solution is to just grab the code and make a program node instead. This doesn't work for my organization since most people are reliant on the GUI to manipulate the SQL underneath.
The other solution is to recreate the query in a new Query Builder node but this particular query is 152 lines of code with several complicated Case Statements and very specific naming of columns and labels.
This error has happened several times after we transitioned over to 7.1 but I have seen other posts having this issue on 5.1 as well.
Is anyone else having this issue with 7.1 and has anyone found a solution for it?
Thank you for any guidance.
05-19-2016 07:51 AM
Well, sounds like a probable bug in the query builder. I recommend that you work with SAS Tech Support on this -- they'll probably want a copy of your project file (if possible) so R&D can see what's happening.
Some other possible workarounds:
- create a query template and see if that allows you to build an editable query. (On the Query RUN button, drop down to Create Template... option. Then open that template from Tasks->Task Templates menu.)
- does it happen only with tables that have nonstandard variable names ("Item#")? If so, is it possible to rename those variables first or else use OPTIONS VALIDVARNAME=V7 when importing/accessing those source tables?
05-19-2016 09:47 AM
Thank you for the speedy response @ChrisHemedinger!
Tried the Task Template, still errored after creating and calling the template.
Our data is coming from an RDBMS mapped to a series of different libraries so we have little control over the naming conventions.
I'll elevate it to SAS Tech Support. Thank you for the guidance!