DOver
DOver

Reputation: 1

Prevent query nodes to reset joins and displaying it falsely in SAS Studio

When working in a SAS Studio 2024.12 (and below) flow I sometimes have a problem with the Query Node, when I alter one of the input nodes/tables. Given setup like:

... -> T1
         \
          [Query Node] -> T3 -> ...
         /
... -> T2

and a join like

Query Join Context Window, showing that t1 and t2 are left joined via columns named 'hash'.

generates code as the following:

/*===========================================================================*
* Nodename:       Join LookUp
* Node-ID:        id-1
*
* Input tables:
*   WORK.InputTable1
*   WORK.InputTable2
*
* Output tables:
*   WORK.OutputTable
*
[...]
*----------------------------------------------------------------------------

/* region: generated setup */
%_flw_action_start(id-1);
/* endregion */

/* Delete table WORK.OutputTable */
proc datasets library = WORK memtype = (data view) nolist nowarn;
   delete OutputTable;
quit;

PROC SQL;
   CREATE TABLE WORK.OutputTable AS
   SELECT 
      t1.*,
      t2.val_x FORMAT=$16. INFORMAT=$64.
   FROM
      WORK.InputTable1 t1
         LEFT JOIN WORK.InputTable2 t2 ON (t1.hash = t2.hash)
   ;
QUIT;
RUN;

/* region: Generated clean up for Join LookUp */
%_flw_action_end(id-1, WORK.OutputTable, WORK, "OutputTable");
/* endregion */

E.g. if I reconnect input 1 (t1) I would understand if the join would just reset, but this is sometimes not the case. Following bugs I encountered so far:

(Renaming the Input Table Node or even the alias inside the Node is also a bad idea...)


I tried to add table nodes before the Query node, so that wouldn't be deleted if I changed the node that outputs that table, but I still encounter those bugs occasionally. Mostly the inconsistency between Query Node and generated code is removed, if I save my changes to the .flw file and reopen it, sometimes resetting the session helps too (at the cost of but losing all work tables).

Rebuilding the Query nodes isn't at worth, because there are many calculated columns I would have to rewrite if a delete the buggy node. Duplicating and using that doesn't help the common problem.


Does one of you encountered this as well? Does someone know how to counteract this display dissonance? Or how to stabilize the node to not reset the Join at all, when a input table slightly changes?

Upvotes: 0

Views: 11

Answers (0)

Related Questions