DATA Step, Macro, Functions and more

Date format change

Occasional Contributor
Posts: 13

Date format change

Hi Team,
I am new in sas programming. Can anyone help me to build the logic of the below.
Here the date is assigned as a char And we are getting output in pdf as for example 03/03/2017. Now the requirement is to change the ouput date look to 03-MAR-17.
Please help me out how it is possible to do.

Super User
Posts: 23,937

Re: Date format change

You need to show how you're using the date and we can then show you how to change the format. 

Super User
Posts: 8,213

Re: Date format change

1. Converting a character date to a SAS date: SASDateVariableName=input(yourdatevariable, anydtdte.);

2. Assign the desired format: format ASDateVariableName mmddyyD10.;


Other variants of that format can be found at:


Art, CEO,


Super User
Posts: 6,899

Re: Date format change

Well, I would never show you have to get a date with a two-digit year.  I hope this is close enough:


data want;

length mydate $ 11;

set have;

mydate = put(input(mydate, mmddyy10.), date11.);



That's assuming that 03/03/2017 is actually in MMDDYY form, rather than DDMMYY form.

Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation