Date: Fri, 8 May 2009 16:19:01 -0700
Reply-To: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject: Re: custom date format
In-Reply-To: A<2784D1B1E1F39E4C91787CFA76BC7E9501DB4E5E@DTSEXEVS01C01.rf01.itservices.ca.gov>
Content-Type: text/plain; charset="us-ascii"
Or here is a way with picture formats:
proc format;
picture ymmdd low-high='%y%0m%0d' (datatype=date);
run;
data _null;
date5=left(put(today(),ymmdd5.));
put (_all_)(=);
run;
See the help doc under the FORMAT procedure, PICTURE statement.
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Choate, Paul@DDS
Sent: Friday, May 08, 2009 4:07 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: custom date format
You mean 90601 not 9060, correct? One way would be
data _null_;
length date5 $5;
date5=substr(put(today(),yymmdd6.),2,5);
put (_all_)(=);
run;
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Paul Lambson
Sent: Friday, May 08, 2009 3:57 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: custom date format
All,
I am working with a horribly laid out database and need to put today()
into this format- ymmdd, a 5 character string. I understand the
downfalls of this format and am currently making a case for it to be
changed by the DBA.
I need some code or a new format to change today() into ymmdd for
example 1 jun 2009 would be 9060.
Thanks for any help.
Paul