How to get all the yyyymm dates between two dates which are in yyyymm format in SAS? -
i have 2 different dates 201509 , 201608. want dates between them in format yyyymm (201509,201510,201511,201512,201601,201602,201603,201604,201605,201606,201607,201608). issue tackling months between years. also, teh months keep changing , might 201601 201612. it's daily run code , i'm trying automate in sas. appreciated!
sas has functions allow must first convert/read dates "sas dates". can use intck count months between start , end , intnx create new month date values.
data months; input (start end)(:yymmn.); format start end yymm.; = 0 intck('month',start,end); month = intnx('month',start,i); output; end; format month yymm.; cards; 201509 201608 ;;;; run; proc print; run;
Comments
Post a Comment