The bounds in the PARM statement must be known numbers. As @sbxkoenk said, you will need to use a macro variable that will substitute appropriate value of Upper_limit_Var1 for each BY group to do what you are trying to do (basically a separate PROC SSM call per BY group).