Sunday, October 4, 2009

Multi-Value Ranges

This was one of my interview questions.

"How do you write a proc format for overlapping values? Can you write down the format for variable: age?"

I have pasted the same here. The multilabel option helps a user in defining format for overlapping values.

proc format;
value age(multilabel)
0 - 12 = "Children"
13 - 19 = "Teenager"
20 - 25 = "Young Adult";
0 - 19 = "Children & Teenager";
low - 25 = "Children, Teenager & Young Adult";
25 - high = "Adult";
run;

Another example:

proc format; 
value cat(multilabel)
90 - high = "90% improvement"
75 - 90 = "75% improvement"
50 - 75 = "50% improvement";
run;

The below example is different one in which the proc format is used for the usual range values...

proc format; 
value rv
120 - high = '5'
60 < 120 = '4'
35 < 60 = '3'
25 < 35 = '2
25 = '1';
run;

What is IDE???


IDE/ Integrated development environment is a programming environment integrated into a software application. It incorporates a GUI builder, a code editor, a compiler and/or an interpreter & a debugger.

The basic features of this IDE for SAS include:
  • Collection of edit macros and templates
  • Creation of new templates
  • SAS highlighting features
  • Indention
  • Fast commenting
  • Expansion of keystrokes into SAS language constructs
  • Development, testing, and fixing (with SAS/PC).

These built-in features in an "Integrated development environment" facilitates a programmer maximize his/ her efficiency and manage time with a fairly large work load.

More: http://multi-edit-2008.software.informer.com/11.2/