Want to add on something really stupid? This is from the days before %sysfunc, putn and the z format...
%let j = %substr(000&j, %length(&j), 4);
For values of j up to 9999, right-justify and zero-fill j. Want longer numbers? Add zeros, and change the last parameter.
I used this construct for years, but the documentation was usually fairly thorough.