hi SamLe,
Is the variable stored as a character variable, or a date variable. You can tell by double-clicking in the column name (or rightclick on the dataset in the explorer and select ‘view columns’.
If the variable is a character (type text), you would need to manipulate the string. Take the substring of positions 1-4 (the year), 5-6 (month) and 7-8 (day) and create a date variable with function mdy.
If the variable is a date, things are easier. A date is stored as a number in memory, and can be displayed using different formats. In that case, you add a ‘format’ statement in a datastep (no other calculations/transformations are needed).
See here for examples: upport.sas.com/documentation/cdl/en/etsug/60372/HTML/default/viewer.htm#etsug_tsdata_sect008.htm
best regards,
Joost