View previous topic :: View next topic |
Author |
Message |
sameermn Beginner

Joined: 08 Aug 2005 Posts: 6 Topics: 3
|
Posted: Fri Nov 04, 2005 5:39 pm Post subject: SAS Clarifications |
|
|
Hi All,
How to convert date in YYYYMMDD format to DD-MMM-YYYY format in SAS?
Also how to prevent zero suppression in SAS?
i.e. iam getting o/p as
' 11111'
but i need it as
'0000011111' _________________ Sameer |
|
Back to top |
|
 |
jetson Beginner
Joined: 07 Oct 2005 Posts: 30 Topics: 2 Location: Texas
|
Posted: Fri Nov 04, 2005 7:19 pm Post subject: |
|
|
Assuming your date field is stored as a SAS internal numeric,
format datevar date9.;
where datevar is the data variable you want to format;
format leadzero z10.;
where leadzero is the numeric variable you want to have leading zero's on. |
|
Back to top |
|
 |
batu544 Beginner
Joined: 02 Aug 2005 Posts: 75 Topics: 27
|
Posted: Tue Nov 08, 2005 5:47 am Post subject: |
|
|
here is a sample code how to change the format
Code: |
data DATE;
infile cards;
input dat YYMMDD10.;
cards;
20051108
;;;;
run;
proc print data=DATE;
format dat DATE9.;
run;
|
this code ll give u the expected result. _________________ Regards,
batu |
|
Back to top |
|
 |
|
|