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
Mention what are the data types does SAS contain?
how will you locate the sas platform applications? : Sas-bi
why is sas considered self-documenting? : Sas programming
what are some differences between proc summary and proc means? : Sas programming
explain the difference between proc means and proc summary?
How would you define the end of a macro? : sas-macro
What are the differences between sum function and using “+” operator?
Have you used macros? For what purpose you have used? : sas-macro
Difference between nodup and nodupkey options?
what other sas products have you used and consider yourself proficient in using? : Sas programming
What are the statements in proc sql?
What are the five ways to do a table lookup in sas? : sas-grid-administration
if the Id has more then two transcatiion then show the first observation, IF Id has only two observation then It show both the observation
What is the use of %include statement?
What is the work of tranwrd function?