Hello ClaireZ, I would not mind helping at all. I do have a quick question for you however, as this answer will determine which way the code goes. You say your date variable is currently formatted as MMYYYY. When you say this, do you mean that the date value is a number input with the actual format MMYYYY (as this is a valid format), or is it a character variable that just happens to say "11998"? Basically the method is different depending on which way your data is stored. If it is a charcter variable you would do something like below data NEWDATA; set OLDDATA; newvariable=mdy(reverse(substr(reverse(compress(Oldvar)),5,2)),15,reverse(substr(reverse(compress(Oldvar)),1,4)); format newvariable mmddyy10.; run; /*Please note this code is not tested, only assumed. Basically what it is doing is scanning the word from right to left for the first 4 values (aka your year), and then scanning the word for the 5th and 6th observation (from the right side, or the 1-2 from the left side). It is then putting these values into the Month, Day, year funciton. If it is stored as an actual number already, I would need to know what day of the month is stored. (Example, if you had the date 3/18/2012 and formatted it as MMYYYY, you would get 03-2012, however the 18th day is still part of the actual date, you are simply not showing it). However for general terms, you could always do this... Data NEWDATA; set OLDDATA: newvariable=intnx('month',OLDVARIABLE,0) + 15; format newvariable mmddyy10.; run; /* Again un-tested but basically what the code is doing is converting the number month to the first of the month, and then adding 15 days to it, giving you the date format that you want*/ Please let me know if that didn't help, as when I have more time tonight I can sit down and test out the code to give you a definitive working answer!
... View more