DATA Step, Macro, Functions and more

intnx

Reply
Contributor
Posts: 30

intnx

Can any1 please help me . I have to calculate field of coupon issuance date .expiry date of coupon is 3 months . But in my data sets i am only having expiry date . Is this the correct way to solve such que 

 

 

data _class_1;

coupon_issuance_date=intnx('02',20,-3,'b');

proc print data = _class_1 noobs;
run;

Super User
Posts: 7,809

Re: intnx

Run your code and read the log.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 30

Re: intnx

Posted in reply to KurtBremser

already done it sir .

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 data _class_1;
63
64 coupon_issuance_date=intnx('02',20,-3,'b');
65
 
NOTE: The data set WORK._CLASS_1 has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
 
66 proc print data = _class_1 noobs;
 
67 run;
 
NOTE: There were 1 observations read from the data set WORK._CLASS_1.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
 
 
68
69 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
82
Super User
Posts: 7,809

Re: intnx

And did you get the result you expected?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 19,822

Re: intnx


mehak wrote:

Can any1 please help me . I have to calculate field of coupon issuance date .expiry date of coupon is 3 months . But in my data sets i am only having expiry date . Is this the correct way to solve such que 

 

 

data _class_1;

coupon_issuance_date=intnx('02',20,-3,'b');

proc print data = _class_1 noobs;
run;


 

No. Review how the INTNX() documentation, there are examples at the bottom of the page. 

http://documentation.sas.com/?docsetId=lefunctionsref&docsetTarget=p10v3sa3i4kfxfn1sovhi5xzxh8n.htm&...

 

Specifically:

INTNX(interval <multiple><.shift-index>,

start-from,

increment

<, 'alignment'>)

 

Compare the parameters above to yours.

The examples are towards the bottom of the page. 

Ask a Question
Discussion stats
  • 4 replies
  • 118 views
  • 0 likes
  • 3 in conversation