BookmarkSubscribeRSS Feed
rishabhmehra13
Calcite | Level 5

i want ot display the coupon issuing date,assuing each coupon is valid for 3 months.coupon expiry is my column having all the dates.

i am getting the value for cissd as

for date 20feb14 cissd 19844 same is for 21feb14.

 

 

 

data cid;
set d.permanent;
cissd=intnx('month',couponexpiry,3);

run;
proc print data=cid;
run;

 

 

could you please help me with this

 

 

log

 

 

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 data cid;
57 set d.permanent;
58 cissd=intnx('month',couponexpiry,3);
59 c=format cissd date9.;
_____
388
76
ERROR 388-185: Expecting an arithmetic operator.
 
ERROR 76-322: Syntax error, statement will be ignored.
 
60 run;
 
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.CID may be incomplete. When this step was stopped there were 0 observations and 18 variables.
WARNING: Data set WORK.CID was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.06 seconds
cpu time 0.07 seconds
 
 
61 proc print data=cid;
62 run;
 
NOTE: There were 1404 observations read from the data set WORK.CID.
NOTE: PROCEDURE PRINT used (Total process time):
real time 30.01 seconds
cpu time 29.74 seconds
 
 
63
64 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
76
1 REPLY 1
Kurt_Bremser
Super User

SAS already puts your nose straight to where you made a mistake:

56 data cid;
57 set d.permanent;
58 cissd=intnx('month',couponexpiry,3);
59 c=format cissd date9.;
_____
388
76
ERROR 388-185: Expecting an arithmetic operator.
 
ERROR 76-322: Syntax error, statement will be ignored.

c=format cissd date9.;

makes no sense.

You probably wanted

data cid;
set d.permanent;
cissd=intnx('month',couponexpiry,3);
format cissd date9.;
run;

Without the format you see the raw value of a SAS date, which is the number of days since 01jan1960.

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 742 views
  • 0 likes
  • 2 in conversation