hi i date is 05sep2005; i want the oupput like

05sep2005:00:00:00 ; how it wil come?

Answers were Sorted based on User's Feedback



hi i date is 05sep2005; i want the oupput like 05sep2005:00:00:00 ; how it wil come?..

Answer / muthyam reddy

data date1;
Date='05sep2005'd;
DateTime=dhms(Date,0,0,0);
put DateTime datetime21.;
format datetime datetime21. date date9.;
run;

second method;

data asd1;
date='05sep2005';
time='00.00.00';
datetime=date||':'||time;
run;

Is This Answer Correct ?    13 Yes 0 No

hi i date is 05sep2005; i want the oupput like 05sep2005:00:00:00 ; how it wil come?..

Answer / siva

date is 05sep2005 but kenny rock taken date as 05sep2005:00:00:00. he is correct if we have date as 05sep2005:00:00:00. what will be code if date is only 05sep2005.

Is This Answer Correct ?    5 Yes 0 No

hi i date is 05sep2005; i want the oupput like 05sep2005:00:00:00 ; how it wil come?..

Answer / kenny rock

data test_date;
input date;
informat date datetime18;
cards;
05sep2005:00:00:00
run;
proc print data=test_date;
format date datetime18.;
run;

Is This Answer Correct ?    14 Yes 10 No

hi i date is 05sep2005; i want the oupput like 05sep2005:00:00:00 ; how it wil come?..

Answer / shakeer

data dt;
informat d date9.;
d= '05sep2005'd;
dt=dhms(d,0,0,0);
format dt datetime21.;
proc print;run;

Is This Answer Correct ?    0 Yes 0 No

hi i date is 05sep2005; i want the oupput like 05sep2005:00:00:00 ; how it wil come?..

Answer / lavanya

data date;
input date datetime18.;
format date datetime20.;
cards;
05sep2005:00:00:00
run;

Is This Answer Correct ?    0 Yes 2 No

hi i date is 05sep2005; i want the oupput like 05sep2005:00:00:00 ; how it wil come?..

Answer / kumar

data test;
input dt : datetime20.;
cards;
05sep2005:00:00:00
;
proc print data=test;
format dt datetime20.;
run;

Is This Answer Correct ?    3 Yes 8 No

Post New Answer

More SAS Interview Questions

What is the maximum length of the macro variable?

0 Answers  


How to get top scorer student from a class-table having different sections A,B, C & D? Each section having same number of students.

2 Answers  


Hi, I have one dataset like id date ex: id date 1 13 1 13Oct2011 2 14 2 14Oct2011 3 15 3 15Oct2011 --->this is the current date here i want date format like 13Oct2011,14Oct2011 how we can modify the numeric to date format plz answer.

4 Answers  


explain the main difference between the nodup and nodupkey options? : Sas-administrator

0 Answers  


how to import HTML files into SAS datasets?

3 Answers   HP,






what is p-value

3 Answers   Accenture, Quintiles, Sristek,


What would the following datastep do? Data _null_; Set Dist end=eof; Call Symput("xx"!!left(put(_n_,2.)),&dimension); If EOF then Call Symput('numrows',left(put(_n_,2.))); Run; dimension is a macro variable that is being passed here

2 Answers  


Can anyone help to find a statement to get all the predefined formats?

3 Answers   Verinon Technology Solutions,


What can you learn from the SAS log when debugging?

0 Answers   Quintiles,


what is the purpose of _error_? : Sas programming

0 Answers  


how can you create zero observation dataset? : Sas programming

0 Answers  


If reading a variable length file with fixed input, how would you prevent SAS from reading the next record if the last variable didn’t have a value?

3 Answers   Accenture,


Categories