i have unique customers list, and would like to get each customer 31 times by adding one full month dates.
result supposed to be as attached.
Hi,
Were you looking for something like the following:
data have;
input custnbr $char6.;
datalines;
123456
123457
123458
123459
123460
123461
123462
123463
123464
;
data want;
set have;
do date='01MAY13'd to '31MAY13'd;
output;
end;
run;
Regards,
Amir.
Hi,
Were you looking for something like the following:
data have;
input custnbr $char6.;
datalines;
123456
123457
123458
123459
123460
123461
123462
123463
123464
;
data want;
set have;
do date='01MAY13'd to '31MAY13'd;
output;
end;
run;
Regards,
Amir.
Thank you so much! can i ask one more question?
below XXXX is any interger.
if any decinmal value is greater than or equal XXXX.995 then it should become XXXX+1 else it should give lower integer XXXX
what could be the finction?
i am using some messy statement like below :
A = 564.995456
B = int(A) = 564
if A - B >= 0.995 then B = B + 1;
Hi,
I'm glad my last post answered your question, feel free to mark it answered if you can and to raise a new discussion for a new question in future. On this occasion, I'm not aware of a function that would directly do what you are asking, but how about the following:
data _null_;
a=564.995456; /* should become 565 */
b=int(a+0.005);
put a= b=;
a=564.994456; /* should stay as 564 */
b=int(a+0.005);
put a= b=;
run;
Regards,
Amir.
Hi,
If there is a chance that the original number could be missing then it might be worth using the sum function which would return 0 if the original was missing. E.g.:
b=int(sum(a,0.005));
Regards,
Amir.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.