Search the site...

SASCRUNCH TRAINING
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
Sentry Page Protection
Please Wait...
Variable Attributes [14-17]


(Best.) Format
The (Best.) format displays the data as the internal values stored in SAS. 

Example
Picture

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;
Picture

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:
Picture

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.
Next

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.

Already a member? Go to member's area.