Hi:
As it says in the doc:
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a000208971.htm
"All parts of the macro language that evaluate expressions (for example, %IF and %DO statements) call %EVAL to evaluate the condition. "
And, if you look at the %DO documentation,
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a000543755.htm
you will see that the start and stop values for %DO must resolve to be:
"...specify integers or macro expressions that generate integers to control the number of times the portion of the macro between the iterative %DO and %END statements is processed."
Therefore, the string 0905 as an INTEGER number is 905.
You can prove this to yourself by turning on the macro debugging options:
options symbolgen mprint mlogic;
I'm betting you will see that &START and &STOP still have the leading 0, but that &J (since it must resolve to an integer number) will be either 905 or 906.
That means you will have to control how &J gets used in building your filenames and variable names. Probably you will need to create another macro variable one that you would use just in the names.
cynthia
[pre]
options mprint symbolgen mlogic;
%macro Asset_history( Start= , Stop= );
%do j = &Start %to &Stop;
** put 0 in MYJ for use in names;
%let myj = %sysfunc(putn(&j,z4.));
%put ***** myj= &myj;
proc sql;
create table HH_Assets_&myj as
.... use &myj instead of &j in the names ...
quit;
... rest of code ...
%end;
%mend;
** test with more values;
%let date1=0905;
%let date2=0908;
%Asset_history( Start=&date1 , Stop=&date2);
[/pre]