Hi ramuking, The reason you are experiencing the error when you change the "start" portionof the %substr to 1 if the quotation marks you have used on the "source" portion of the %substr. Macro language, unlike dataset, is purely text. So there is no need for you to use quotations in your %substr function, as text is all it will read. So when you are including the quotation marks the result you are getting from the %substr is "cmsdy, making your datastep read: data d; a = "cmsdy; run; and this is why it does not work. In contrast, when you used 2 as your "start" your %substr function return cmstdy, making your datastep read: data d; a = cmstdy; run; as you desired. So long story short, don't include the quotation marks in the source portion of your %substr function. Hope this helps! 🙂
... View more