SAS | Date Formats and Informats Last Updated : 30 Jul, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report Informats is used to tell SAS how to read a variable whereas Formats is used to tell SAS how to display or write values of a variable. Informats is basically used when you read in sample data which is being created using CARDS/DATALINES statement or read or import data from either an external file (Text/Excel/CSV). Formats can be used in both Data Steps and PROC Steps whereas Informat can be used only in Data Steps. Example: Read Dates in SAS In the example below, we have used INFORMATS ddmmyy8. and ddymmyy10. to read dates in SAS. It creates a dataset called sampledata which is stored in WORK library. SQL DATA sampledata; INPUT @6 date1 ddmmyy8. @15 date2 ddmmyy10.; CARDS;20-07-19 20-07-2019 ; RUN; The INFORMATS ddmmyy8. is used to read 20-07-19 date and ddmmyy10. to read 20-07-2019 date. In defined syntax above, 8 and 10 refers to width of the date. The created dataset looks like below - It returns 21750 as it is in the SAS date value form. It is not meaningful if you look at the value. You cannot tell which date it is. To display the date in usual date format, use FORMAT statement. SQL DATA sampledata; INPUT @6 date1 ddmmyy8. @15 date2 ddmmyy10.; FORMAT date1 ddmmyy8. date2 ddmmyy10.; CARDS;20-07-19 20-07-2019 ; RUN; Output: How to read DD-MMM-YY format You can use date11. format for both DD-MMM-YY and DD-MMM-YYYY format. SQL DATA temp; INPUT @6 dt date11.; FORMAT dt date11.; CARDS;20-jul-19 ; PROC PRINT noobs; RUN; Output: Comment More infoAdvertise with us Next Article How to Create or Modify a Variable in SAS Programming? S ShubhamMaurya3 Follow Improve Article Tags : Software Engineering SAS Programming Similar Reads How to import data into SAS? Entering Data Directly: You can enter numbers of lines of data directly in SAS program by using a DATALINES statement. The keywords are as follows: DATA: The DATA step always starts with a DATA statement. The purpose of the DATA statement is to tell SAS that you are creating a new data set i.e. outd 3 min read Difference between SAP and SAS If the business and organizations are involved in processes, which require the utilization of large amounts of data, its management and analysis for purposes of decision-making becomes crucial. One commercial software solution being used by businesses to handle data is SAP while the other is SAS, al 4 min read SAS Full Form SAS (Statistical Analysis System) is a comprehensive software suite developed by SAS Institute Inc., used globally for advanced analytics, business intelligence, data management, and predictive analytics. Developed between 1966 and 1976, SAS has evolved with advanced statistical techniques, point-an 4 min read SAS : How to Display Current Date? The today() function of SAS programming is basically used to generate current date. The format() function is used to display the format of the date in the specified format. In DD-MMM-YYYY format: Example: SQL data _null_; dt=today(); format dt yymmdd10.; put dt ; run; Output: In DDMMMYYYY format: Ex 1 min read How to Create or Modify a Variable in SAS Programming? This will help you to create or modify a variable. It is common to define a new variable based on the existing variable. Let's create a dataset In the code below, we are creating a dataset named as Example1 which is going to store on WORK(temporary) library. In this dataset, there would be a variabl 2 min read Data Type Conversion in MATLAB Data Types in MATLAB is the upheld information organizes that are utilized for calculation. MATLAB is a well-known numerical and factual information investigation instrument that has a large number of elements for calculation. The different kinds of data type MATLAB supports are numeric types, chara 3 min read Like