Not applicable
Posts: 0

# Getting a date in the future

Hi All

How do I go about getting a data in the future and assigning this to a value. For example, I have to read in a list of value, e.g. A1, A2, A3 - each of these will have different due terms - e.g. A1 = Payable in 1 mth on the 25th, A2 = Payable in 2 mth on the 25th etc

So, how do I get the 25th of the following TWO and THREE months to assign to a value. I was thinking of using INTX function but don't that will work.

Shelton.
Valued Guide
Posts: 653

## Re: Getting a date in the future

INTNX should do the trick. One solution might be something like:

[pre]
date=today();
a1=1; a2=2; a3=3;
run;
[/pre]
Super User
Posts: 10,770

## Re: Getting a date in the future

Hi. INTX function has the fourth argument 'sameday' can obtain the same day after two or three months.

followdate = intnx('month',A1,2,'sameday');
Not applicable
Posts: 0

## Re: Getting a date in the future

thanks all for your help - I did the following:

IF NPAYTERM = 'A1' THEN DO;
NEXT_MON=INTNX('MONTH',DOCDATE,1) + 24;
R3DUED=PUT(NEXT_MON,YYMMDD10.);
SUBSTR(R3DUED,5,1) = '-';
SUBSTR(R3DUED,8,1) = '-';
PUT R3DUED;
END;

ELSE IF NPAYTERM = 'A2' THEN DO;
TWOMONTS=INTNX('MONTH',DOCDATE,2) + 24;
R3DUED=PUT(TWOMONTS,YYMMDD10.);
SUBSTR(R3DUED,5,1) = '-';
SUBSTR(R3DUED,8,1) = '-';
PUT R3DUED;
END;

etc etc

Thanks again.
Valued Guide
Posts: 653