Sentry Page Protection
Variable Attributes [14-17]
(Best.) Format
The (Best.) format displays the data as the internal values stored in SAS.
Example
Example
The DATETIME data set above contain a list of date and time.
The Date and Time variable are formatted with the (YYMMDD10.) and the (TIME5.) formats.
Now, let's take a look at how the data looks like with the (Best.) format.
Example
Data DateTime2;
Set DateTime;
Format Date Time Best.;
Run;
The (Best.) format displays the internal values stored in SAS.
It is useful when you need to remove any special formats from a variable.
Exercise
Copy and run the code from the yellow box below:
You have received a data set with the survey results.
The variables Q1 to Q4 are formatted with the (QUES.) format.
However, you need to find out the coded values before conducting the analysis.
Format the variables Q1, Q2, Q3 and Q4 so that they show the internal values stored in SAS.
Create any data set or variables if needed.
Need some help?
HINT:
A simple (best.) format should do the job.
SOLUTION:
Data Survey2;
Set Survey;
Format Q1 Q2 Q3 Q4 Best.;
Run;
Fill out my online form.