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
what are several options for creating reports in web report studio? : Sas-bi
what has been your most common programming mistake? : Sas programming
What is a macro routine?
Of all your work, where have you been the most successful?
How would you define the end of a macro? : sas-macro
Briefly explain input and put function?
How to read an input file in sas?
What is substr function?
What is the function of output statement in a SAS Program?
Approximately what date is represented by the SAS date value of 730?
Explain how you can debug and test your SAS program?
what is the use of sas management console? : Sas-di
What is the use of function Proc summary?
How do you use the do loop if you don’t know how many times you should execute the do loop?
Which command is used to save logs in the external file?