yymm date informat

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

yymm date informat

Hi All,

What is the best way to convert the date values below into SAS dates? The values are composed of four-digit year and two-digit month (e.g. 199106).

data dates;

input date1;

cards;

199108

199206

199206

200007

200006

;

Thanks for any help you can give me.


Accepted Solutions
Solution
‎05-31-2015 09:41 PM
Trusted Advisor
Posts: 1,137

Re: yymm date informat

The informat to read the yymm date values is YYMMNw. informat and teh format to display the same is YYMMw.

data dates;

input date1 :yymmn6.;

format date1 yymm7.;

cards;

199108

199206

199206

200007

200006

;

Thanks,

Jag

Thanks,
Jag

View solution in original post


All Replies
Solution
‎05-31-2015 09:41 PM
Trusted Advisor
Posts: 1,137

Re: yymm date informat

The informat to read the yymm date values is YYMMNw. informat and teh format to display the same is YYMMw.

data dates;

input date1 :yymmn6.;

format date1 yymm7.;

cards;

199108

199206

199206

200007

200006

;

Thanks,

Jag

Thanks,
Jag
New Contributor
Posts: 2

Re: yymm date informat

Thank you Jag!

Super User
Posts: 11,134

Re: yymm date informat

Note: the day of the month of these variables will be 1.

🔒 This topic is solved and locked.

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

Discussion stats
  • 3 replies
  • 504 views
  • 1 like
  • 3 in conversation