Yes, I am sorry I should have used ampersand in this particular case. But I am just curious, why can't we use a variable in this statement. What I want to as is, why the below code is producing 0 as output: Data xx; Var2='Lorem ipsum dolor'; %Let position2=%sysfunc(Find(%Substr(Var2,1,16),%str( ),-15)); Run; %PUt &Position2.; Is it because SAS is considering Var2 as a string instead of a variable? And I need substr because I want to cut the Var2 variable in two variables, each should not have more than 16 characters (Hence %substr)and no word should be cut off in between (hence finding the last space before 16th character). The whole code is not here. Once I figure out the position of last space before 16th character, it will be pretty easy. So, please help me to fix this, as making Var2 a Macro variable will be a cumbersome process in my situation. Regards, Saugata Mukherjee.
... View more