How to convert a given date value into SAS date

Answer Posted / vinay

/*let date is '10/07/1985'/*
/*SAS CODING*/
data date;
input date $;
Var_Date=input(date,mmddyy10.);/*Apply format within input
function to convert text value to number value*/
/*now extract value of month,date and year through date
functions*/
m=substr(Var_Date,4,2);
d=substr(Var_Date,1,2);
y=substr(Var_Date,7,4);
sasdate=mdy(m,d,y);
cards;
10/07/1985
;
run;
proc print dtat=date;
run;

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain bmdp procedure?

616


What are the difference between ceil and floor functions in sas?

711


Explain the difference between using drop = data set option in set and data statement?

686


what is proc Index? and what is proc document?

1998


what are the types of interactive display types? : Sas-bi

656






How do you specify the number of iterations and specific condition within a single do loop?

625


for whom is sas data integration studio designed? : Sas-di

556


How to create an external dataset with sas code?

590


How do you test for missing values?

1060


which date function advances a date, time or datetime value by a given interval? : Sas programming

600


What is the function of Stop statement in a SAS Program?

645


What are the different versions of sas that you have used until now? : sas-grid-administration

735


How to create list output for cross-tabulations in proc freq?

624


what do you mean by data staging area? : Sas-di

605


Name few SAS functions?

670