diff --git a/ComputingTasks.cc b/ComputingTasks.cc
index 9acdc06ae9069c8873749de7bd73dc2abffa7db2..1274858b28be516d882333e34560b0046bbf1b77 100644
--- a/ComputingTasks.cc
+++ b/ComputingTasks.cc
@@ -1237,6 +1237,29 @@ OsrParamsStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolid
   mod_file_struct.osr_params_present = true;
 }
 
+Statement *
+OsrParamsStatement::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 osr_params 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 OsrParamsStatement(new_symbol_list);
+}
+
 void
 OsrParamsStatement::writeOutput(ostream &output, const string &basename) const
 {
diff --git a/ComputingTasks.hh b/ComputingTasks.hh
index 3a4df94be87357c90148cfeb32bbec7f1f3ba020..88d51c2cdacbecbb134dd549e0921594c6c14b83 100644
--- a/ComputingTasks.hh
+++ b/ComputingTasks.hh
@@ -233,6 +233,7 @@ public:
   OsrParamsStatement(const SymbolList &symbol_list_arg);
   virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
   virtual void writeOutput(ostream &output, const string &basename) const;
+  virtual Statement *cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table);
 };
 
 class OsrStatement : public Statement