MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SAS Clarifications

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
sameermn
Beginner


Joined: 08 Aug 2005
Posts: 6
Topics: 3

PostPosted: Fri Nov 04, 2005 5:39 pm    Post subject: SAS Clarifications Reply with quote

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
View user's profile Send private message
jetson
Beginner


Joined: 07 Oct 2005
Posts: 30
Topics: 2
Location: Texas

PostPosted: Fri Nov 04, 2005 7:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
batu544
Beginner


Joined: 02 Aug 2005
Posts: 75
Topics: 27

PostPosted: Tue Nov 08, 2005 5:47 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group