Transition to new steady state using separate matlab file

Hi,
I am trying to compute transition from one steady state to the other. I have a separate matlab file which computes the steady state. I find a lot of posts/codes where people have manually entered initval and endval block and computed the transition path…my model has more than 100 variables…i would like to use a more intellegent way of using the separate matlab file to compute both steady states…one with ERW =1 and the other with ERW=0.98…this is a permanent change in the exogenous variable that I am trying to exeriment…I made the following additons to my code

initval;
ERW = 1;
end;

steady;
resid;

endval;
ERW = 0.98;
end;

steady;

Dynare computes the steady stae for the initval, but cannot compute the second one and shows the residual equal to 0.02 (1-0.09)…I can separately compute both steady state on matlab…but how do i incorporate both versions n one dynare file…please help!

Use

perfect_foresight_setup(periods=x);

to set up the basic problem. It will create oo_.endo_simul and oo_.exo_simul. You can now write your steady states into the first and last entry of oo_.endo_simul and then run

perfect_foresight_solver;

to find the solution