## IF ONE VARIBLE HAVE A DIFFRENT DATE FORMAT

Solved
Occasional Contributor
Posts: 7

# 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 :smileysillylz 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
Posts: 1,270

## Re: IF ONE VARIBLE HAVE A DIFFRENT DATE FORMAT

Try this.

data want;

set date;

d2=input(d1,anydtdte10.);

format d2 date9.;

run;

All Replies
Solution
‎01-06-2015 01:50 AM
Posts: 1,270

## Re: IF ONE VARIBLE HAVE A DIFFRENT DATE FORMAT

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

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.