As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.
Here are some tips for How to share your SAS knowledge with your professional network.
Tip of the Day
sasCommunity Tip of the Day
The majority of the time the numeric formats provided in SAS are enough to deal with datetime values. However, there may be times when the formats provided do not meet our needs. Recently I've been asked to write out a SAS data set into a flat file and for a datetime variable the condition was to be written in the form of dd-mm-yyyy hh:mm:ss. The standard datetime format provided did not meet the requirement so in order to create the new format type I used the code below:
proc format; picture MyMSdt other='%0d-%0m-%0Y %0H:%0M:%0S' (datatype=datetime); run; data test; mydatetime='25nov2009 14:44:56'dt; format newdt MyMSdt.; newdt=mydatetime; put mydatetime= newdt=; run;
The LOG shows:
See also Tips:Pound sign using picture format
Submitted by Alberto Negron. Contact me at my Discussion Page.
Feel free to comment on this tip.
Tips Index by Status
The Tip of the Day Project
A new technical Tip of the Day related to SAS software will be shown on this page and the sasCommunity.org main page every day. Before getting started, you can Browse and Search the current list of tips contributed by users.
Anyone can participate. We hope you do! Here's how:
- Submit a Tip by posting a SAS tip that you think others might find useful
- Review a Tip prior to publishing