Desktop productivity for business analysts and programmers

adding days to a mmyy format

Occasional Contributor
Posts: 12

adding days to a mmyy format

Hi Everyone,


Currently my date variable is in the format of mmyy (i.e. 01/2010)


I used the following code to read the data. While everything is read correctly, it automatically added first day of the month for each DOB (i.e. 01May1990).


data temp;
infile 'C:\users\';
informat DOB anydtdte.;
format DOB date9.;
input DOB

 Is there a way to add the 15th day of the month instead?


For simplicity I left out all the other variables like gender, postal code etc from informat and input function.


Thanks in advance!! 


Super User
Posts: 23,928

Re: adding days to a mmyy format

Add 14 to the variable. Variable = Variable + 14;


Use INTNX to set the value to mid month, check the documentation for options for last parameter which is alignment.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation