BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zimcom
Pyrite | Level 9

Greetings!

 

What I have is a SAS data variable (e.g., 2015-03-07)

What I want is to add one year to the above variable (e.g., 2016-03-07)

 

When I used 

 

DSDAT = intnx('year',DSDAT,1);

 

I got "2016-01-01", any idea why I did not get "2016-03-07"

 

Thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

Try

 

DSDAT = intnx('year',DSDAT,1,'s');

's' stands for SAME meaning you are requesting to shift the default

View solution in original post

2 REPLIES 2
novinosrin
Tourmaline | Level 20

Try

 

DSDAT = intnx('year',DSDAT,1,'s');

's' stands for SAME meaning you are requesting to shift the default

zimcom
Pyrite | Level 9

@novinosrin You are great help to me, thank you so much!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 3910 views
  • 1 like
  • 2 in conversation