Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert date in char to SAS date

Status
Not open for further replies.

sunny567

MIS
Jun 14, 2006
6
EU
Friends,
I have a db2 date unloaded in character format eg. 31.12.2005 (DB2 length=10). I need to convert it into a SAS date format before writing to a SAS dataset. How can I do this? Please help. Also how to handle the timestamp (DB2 length=26).

also what is the SAS datatype for DECIMAL(11,2)? I think it is PD6.2. Please correct.

Thanks!!!
 
also what I can do in the below query to ensure that the input date (which is in format 20.07.2006) is stored as SAS date in SAS dataset?

proc sql;
create table tab1.maxdate as
select
max(entry_dte) as max_ent_date
from
regentry;
quit;




 
friends, the below is working fine.

create table tab1.maxdate as
select
input(max(entry_dte), ddmmyyyy10.) as max_ent_date from
regentry;
quit;

guess timestamp also should workfine with 'datetime' format.

Thanks!!! (sorry for this silly post)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top