11-24-2016 05:48 AM
I'm working with SAS, and I have this formatdate 200103;
I need to find the first and the last day in these dates, that's to say
først day would be 20010301
last day would be 20010331
I did this:
But I'm finding any most direct and short. Is this possible?
11-24-2016 05:56 AM
I did it now:
Is that the only one way?
I'm finding any more short
11-24-2016 06:11 AM
Date = input( aarm, yymmn6.);
start_date=intnx('month', date, 0, 'b');
end_date=intnx('month', date, 0, 'e');
format date start_date end_date yymmdd8;
If you really want, you can nest the functions to get rid of the first step, but I thought it helped for clarity.
11-24-2016 05:55 AM
data test2; set test1; datoa = mdy(mod(aarm,100),1,int(aarm/100)); datoz = intnx('month',datoa,0,'end'); format datoa datoz yymmdd10.; run;
11-24-2016 06:27 AM
It was fine but I has recived like a result any like this:
But I would like any with this formate:
Is this possible?
If you meant my code, just change the format to yymmddn8.
Be aware that both my new variables contain SAS date values.