diff --git a/ComputingTasks.cc b/ComputingTasks.cc
index caad9f15885d3cc7d6e19bd9773c3c321bcca2f4..c4dc0778b05cd9c7d847102c848dddd7e24829d7 100644
--- a/ComputingTasks.cc
+++ b/ComputingTasks.cc
@@ -1946,6 +1946,29 @@ ShockDecompositionStatement::ShockDecompositionStatement(const SymbolList &symbo
 {
 }
 
+Statement *
+ShockDecompositionStatement::cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table)
+{
+  SymbolList new_symbol_list;
+  try
+    {
+      SymbolTable *new_symbol_table =  dynamic_datatree.getSymbolTable();
+      vector<string> symbols = symbol_list.get_symbols();
+      for (vector<string>::const_iterator it = symbols.begin(); it != symbols.end(); it++)
+        {
+          new_symbol_table->getID(*it);
+          new_symbol_list.addSymbol(*it);
+        }
+    }
+  catch (SymbolTable::UnknownSymbolNameException &e)
+    {
+      cerr << "ERROR: A variable in the shock_decomposition statement was not found in the symbol table" << endl
+           << "       This likely means that you have declared a varexo that is not used in the model" << endl;
+      exit(EXIT_FAILURE);
+    }
+  return new ShockDecompositionStatement(new_symbol_list, options_list);
+}
+
 void
 ShockDecompositionStatement::writeOutput(ostream &output, const string &basename) const
 {
diff --git a/ComputingTasks.hh b/ComputingTasks.hh
index 7d8a7a3b2f790b758de297e0226b2233f52454c1..03b1f4cec3633613237b69a8a46e36771c3bc1c2 100644
--- a/ComputingTasks.hh
+++ b/ComputingTasks.hh
@@ -544,6 +544,7 @@ public:
   ShockDecompositionStatement(const SymbolList &symbol_list_arg,
                               const OptionsList &options_list_arg);
   virtual void writeOutput(ostream &output, const string &basename) const;
+  virtual Statement *cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table);
 };
 
 class ConditionalForecastStatement : public Statement