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
Explain bmdp procedure?
What are the difference between ceil and floor functions in sas?
Explain the difference between using drop = data set option in set and data statement?
what is proc Index? and what is proc document?
what are the types of interactive display types? : Sas-bi
How do you specify the number of iterations and specific condition within a single do loop?
for whom is sas data integration studio designed? : Sas-di
How to create an external dataset with sas code?
How do you test for missing values?
which date function advances a date, time or datetime value by a given interval? : Sas programming
What is the function of Stop statement in a SAS Program?
What are the different versions of sas that you have used until now? : sas-grid-administration
How to create list output for cross-tabulations in proc freq?
what do you mean by data staging area? : Sas-di
Name few SAS functions?