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
How would you identify a macro variable?
What is the difference between INPUT and INFILE ?
what is the basic structure sas administrator? : Sas-administrator
How to sort in descending order?
how to remove duplicates using proc sql?
What do the SAS log messages "numeric values have been converted to character" mean?
What are SAS/ACCESS and SAS/CONNECT?
Hi,by usining ptf how we have to combine (likr merge)10 datasets at a time in the oracle database(and write a macro code also)?Like this i have a douts a lot if you dont mind may please send one text mail for me(madhusudhanap16@gmail.com)?
Which are the statements whose placement in the data step is critical?
how does sas handle missing values in assignment statements? : Sas programming
Mention the validation tools used in SAS?
What is the difference between where and if statement?
What can you learn from the SAS log when debugging?
Do you need to rearrange the order of the data for the report?
What areas of SAS are you most interested in?