Help using Base SAS procedures

date format cheat sheet?

Reply
Frequent Contributor
Posts: 100

date format cheat sheet?

Greetings:
New user here. Tired of looking up which date format to use from several sources. Does anyone know a good list of commonly used date format so I can just print out a cheatsheet? It is fun to dig for them but don't always have the time.
Thanks
SAS Super FREQ
Posts: 8,684

Re: date format cheat sheet?

Hi:
I'm a big fan of the documentation topic "Formats by Category"
http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/...

cynthia
Frequent Contributor
Posts: 100

Re: date format cheat sheet?

Thank you. I will start from here and add some examples of formatted values.
Valued Guide
Posts: 2,168

Re: date format cheat sheet?

I like to refer to the "informat hunter" http://listserv.uga.edu/cgi-bin/wa?A2=ind0705B&L=sas-l&P=58404 (which I posted to SAS-L a few years ago).
It is just SAS9 data step code trialling all available formats to demonstrate how a sample of your value could be read. Easy exercise to adapt to demonstrate formats instead of informats.
Rather than loop through your data, the "format hunter" loops through sashelp.vformat.
The PUT() function must have its format hard-coded at compile-time, but the putN(), and inputN() fumctions allow the format to be defined at run-time, so we can get SAS to replace the cheat-sheet at http://www.sascommunity.org/wiki/TS_486_Functions,_Informats,_and_Formats with a fully complete review of every single format/informat available in your session (including user-defined formats and informats). Vformat even provides the min and max widths valid for each format (except for user formats :-( but ) It is a great resource

peterC
Frequent Contributor
Posts: 100

Re: date format cheat sheet?

Thanks but not just for answering my specific question. I checked out the two resources you mentioned: http://www.sascommunity.org and the SAS-L....I've heard of them before yet never expected them to be useful for the very beginners. So much to learn from everywhere!
Ask a Question
Discussion stats
  • 4 replies
  • 508 views
  • 0 likes
  • 3 in conversation