Hello everyone, I feel like my issue is a simple one yet I have been stuck on this for hours. I am trying to convert a SAS date variable (datetime20. format) into a string of characters YYYYMMDD inside a macro (code lines in bold). My macro calculates the number of months between my start and end date and then executes another macro (%request) at each incremented month. I need to transform my start date (a SAS date) to a string YYYYMMDD so that the second macro will run. When I run my programme I get stuck at the first loop and I come across this note : NOTE : Macro variable CHAR_DAY resolves to inputn('01JUL2014'd,yymmddn8.). It doesn't look like it's converting my date to a string. Could anyone help? Many thanks, Juliette %macro hormono(start_dt=,end_dt=); %let nbmonths=%eval(%sysfunc(intck(month,&start_dt.,&end_dt.))); %do i=0 %to &nbmonths; %if &i=0 %then %do; %let char_day=inputn(&start_dt.,yymmddn8.); %request(database, &char_day.); %end; %else %do; %let char_day2=inputn(%sysfunc(intnx(month,&start_dt,&i,s)),yymmddn8.); %request(temp, &char_day2.); proc sql; insert into database select * from temp; quit; %end; %end; %mend hormono;
... View more