IF ONE VARIBLE HAVE A DIFFRENT DATE FORMAT

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

IF ONE VARIBLE HAVE A DIFFRENT DATE FORMAT

IF ONE VARIBLE HAVE  A DIFFRENT DATE FORMAT how can we read

EX:=

data date;

length d1 $ 10.;

  d1='13sep2002'd;output;

  d1='13/05/2002'd;output;

  d1='2002-05-13'd;output;

  run;

o/p

d1

13sep2002

13/05/2002

2002-05-13

i want to read this in to single format :smileysillySmiley Tonguelz give me answer for this like in D2 varible i want date9. format for these 3 obs


Accepted Solutions
Solution
‎01-06-2015 01:50 AM
Trusted Advisor
Posts: 1,228

Re: IF ONE VARIBLE HAVE A DIFFRENT DATE FORMAT

Posted in reply to rohithrao

Try this.

data want;

set date;

d2=input(d1,anydtdte10.);

format d2 date9.;

run;

View solution in original post


All Replies
Solution
‎01-06-2015 01:50 AM
Trusted Advisor
Posts: 1,228

Re: IF ONE VARIBLE HAVE A DIFFRENT DATE FORMAT

Posted in reply to rohithrao

Try this.

data want;

set date;

d2=input(d1,anydtdte10.);

format d2 date9.;

run;

Contributor
Posts: 22

Re: IF ONE VARIBLE HAVE A DIFFRENT DATE FORMAT

Posted in reply to rohithrao

I guess this might help you.

      data want;

    input date anydtdte10.;

   format date date9.;

datalines;

13sep2002

13/05/2002

2002-05-13

;

run;

Occasional Contributor
Posts: 7

Re: IF ONE VARIBLE HAVE A DIFFRENT DATE FORMAT

thanks for giving this feedback

🔒 This topic is solved and locked.

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

Discussion stats
  • 3 replies
  • 229 views
  • 5 likes
  • 3 in conversation