Help using Base SAS procedures

Why MMDDYYN8. Informat doesn’t work?

Accepted Solution Solved
Reply
Super Contributor
Posts: 338
Accepted Solution

Why MMDDYYN8. Informat doesn’t work?

Hi SAS Forum,

I have two date values like below.

03312012 /*this means March 31, 2012*/

04302012 /*this means April 30, 2012*/

Q: I wanted to convert these two values to display like below.

03/31/2012

04/30/2012

I googled and found if the date is in format like this, i.e. 03312012, 04302012 etc., it is called MMDDYYN8.

So, I have used below approach for my intended conversion.

data have;

informat date MMDDYYN8.;

input date;

format date MMDDYY10.;

cards;

03312012

04302012

;

run;

Problem:

SAS complains like below …..

16         informat date MMDDYYN8.;

                         _________

                         485

NOTE 485-185: Informat MMDDYYN was not found or could not be loaded.

Could anyone let me know what informat then should I specify to read dates in these date formats, i.e. 03312012, 04302012  ?

Thanks

Miris


Accepted Solutions
Solution
‎01-31-2014 04:39 PM
Frequent Contributor
Posts: 106

Re: Why MMDDYYN8. Informat doesn’t work?

data have;

input date MMDDYY8.;

format date MMDDYYN8.;

cards;

03312012

04302012

;

run;

MMDDYYN8. is format, not informat

View solution in original post


All Replies
Super Contributor
Posts: 578

Re: Why MMDDYYN8. Informat doesn’t work?

I think the informat is MMDDYY8. without the N.  Normally the N in a date format means no delimiters.

Solution
‎01-31-2014 04:39 PM
Frequent Contributor
Posts: 106

Re: Why MMDDYYN8. Informat doesn’t work?

data have;

input date MMDDYY8.;

format date MMDDYYN8.;

cards;

03312012

04302012

;

run;

MMDDYYN8. is format, not informat

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 1433 views
  • 4 likes
  • 3 in conversation