Help using Base SAS procedures

Date Format

Reply
Regular Contributor
Posts: 229

Date Format

HI i have a date it is in 20050110 in the form of year month and date now i want it to be in 10/01/2005 how can i do it
Contributor
Posts: 61

Re: Date Format

Hi user,

data test;
input date yymmdd8.;
cards;
20050110
;
proc print;
format date ddmmyy10.;
run;

Venkatesh.
Super User
Posts: 5,429

Re: Date Format

Is this data stored as a SAS date value, with a column format on it, a numerical column with value 20050110 or a char value?

If it's the first case, just change/use another date format: ddmmyy10.

If it's the other situations, you need to convert the columns to SAS date values first, by using INPUT/PUT functions. Read on-line doc, forum posts, papers etc on support.sas.com for examples.

/Linus
Data never sleeps
Ask a Question
Discussion stats
  • 2 replies
  • 122 views
  • 0 likes
  • 3 in conversation