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
describe the interaction table in sas di? : Sas-di
which date function advances a date, time or datetime value by a given interval? : Sas programming
what is a method for assigning first.var and last.var to the by groupvariable on unsorted data? : Sas programming
How to convert a numeric variable to a character variable?
Describe the ways in which you can create macro variables? : sas-macro
Which command is used to perform sorting in sas program?
how does sas handle missing values in functions? : Sas programming
Which command is used to save logs in the external file?
Describe what are the different levels of administrative users in sas? : sas-grid-administration
For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration
what is sas business intelligence? : Sas-bi
Have you ever used the SAS Debugger?
What is PROC in SAS?
what are sas/access and sas/connect? : Sas programming
If you could design your ideal job, what would it look like?