BookmarkSubscribeRSS Feed
_WJ
Calcite | Level 5 _WJ
Calcite | Level 5

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.

3 REPLIES 3
ChrisHemedinger
Community Manager

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?

 

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
_WJ
Calcite | Level 5 _WJ
Calcite | Level 5

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!

karonds
Calcite | Level 5

way late to the game on this one, but I came across this post hoping for an answer when I had the same problem.  YMMV, but my "Item has already been added. Key in Dictionary" issue stemmed from emailing attachments from multiple process flows. I simply deleted all my shortcuts from my process flow that handled the email function, then rebuilt the "send as a step in the project" adding the other shortcuts.reran the project and voila, no more errors. 

 

hope this helps someone, good luck!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1690 views
  • 1 like
  • 3 in conversation