Practice Questions on Date Formats and Informats in SAS
Question 1: DMY Format with Slashes
Data Values:
"15/07/2025" "01/01/2024" "30/12/2023" "10/04/2022" "25/08/2020"
Task:
Write the appropriate `INFORMAT` and `FORMAT` in a SAS data step to read these values
and display them in `DATE9.` format.
Question 2: Date with Month Name (abbreviated)
Data Values:
"15JUL2025" "01JAN2024" "30DEC2023" "10APR2022" "25AUG2020"
Task:
Write the suitable `INFORMAT` and `FORMAT` to read and display these values as SAS date
values in `DDMMYY10.` format.
Question 3: Date with Dashes in YMD Order
Data Values:
"2025-07-15" "2024-01-01" "2023-12-30" "2022-04-10" "2020-08-25"
Task:
Write the `INFORMAT` and `FORMAT` required to read these character values and convert
them into SAS date values displayed as `WORDDATE18.`
Question 4: Date in MDY Format with Slashes
Data Values:
"07/15/2025" "01/01/2024" "12/30/2023" "04/10/2022" "08/25/2020"
Task:
Write the informat and format to read the values above and display them in `MMDDYY10.`
format.
Question 5: Date with Full Month Names
Data Values:
"15 July 2025" "1 January 2024" "30 December 2023" "10 April 2022" "25 August 2020"
Task:
Determine which `INFORMAT` can read these values, and specify a suitable `FORMAT` to
display them in `DATE11.` format.