Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

20
Creating Extensive Creating Extensive Shift Tables Shift Tables OR OR How I Learned to Type How I Learned to Type 1,388,571 wpm! 1,388,571 wpm! Kelley Weston Kelley Weston

Transcript of Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Page 1: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Creating Extensive Shift Creating Extensive Shift TablesTables

OR OR

How I Learned to Type How I Learned to Type 1,388,571 wpm!1,388,571 wpm!

Kelley WestonKelley Weston

Page 2: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

The goal:The goal:

Create a format that would consist of all the Create a format that would consist of all the possible combinations of several values.possible combinations of several values.

For example:

"M1TM" - "M1TM" = "Missing to 1+ to Trace to Missing"

Page 3: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

The usual way of accomplishing The usual way of accomplishing this:this:

Typing all the combinations into a format. Typing all the combinations into a format.

When there are only 4 or 5 possible values When there are only 4 or 5 possible values in 2 positions, this is no problem.in 2 positions, this is no problem.

Page 4: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

The problem:The problem:

We are starting with 7 values, in each of 4 We are starting with 7 values, in each of 4 positions. This results in 7 * 7 * 7 * 7 = positions. This results in 7 * 7 * 7 * 7 = 24012401 combinations. The problems include: combinations. The problems include:

timetimeensuring that all possible combinations are ensuring that all possible combinations are accounted for, with no repetitions or accounted for, with no repetitions or omissionsomissionsaccuracyaccuracy

Page 5: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

What I need to create:What I need to create:

Page 6: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

value $CAT_ALL (default = 40 fuzz = 0 min = 1 max = 40 ) "----" - "----" = “missing" "---1" - "---1" = "- to 1+" "---2" - "---2" = "- to 2+" "---M" - "---M" = "- to Missing" "---N" - "---N" = "- to None" "---O" - "---O" = "- to Other" "---T" - "---T" = "- to Trace" "--1-" - "--1-" = "- to 1+" "--11" - "--11" = "- to 1+ to 1+" "--12" - "--12" = "- to 1+ to 2+" "--1M" - "--1M" = "- to 1+ to Missing" "--1N" - "--1N" = "- to 1+ to None" "--1O" - "--1O" = "- to 1+ to Other" "--1T" - "--1T" = "- to 1+ to Trace" "--2-" - "--2-" = "- to 2+" "--21" - "--21" = "- to 2+ to 1+" "--22" - "--22" = "- to 2+ to 2+" "--2M" - "--2M" = "- to 2+ to Missing" "--2N" - "--2N" = "- to 2+ to None" "--2O" - "--2O" = "- to 2+ to Other" "--2T" - "--2T" = "- to 2+ to Trace" "--M-" - "--M-" = "- to Missing" "--M1" - "--M1" = "- to Missing to 1+" "--M2" - "--M2" = "- to Missing to 2+" "--MM" - "--MM" = "- to Missing to Missing" "--MN" - "--MN" = "- to Missing to None" "--MO" - "--MO" = "- to Missing to Other" "--MT" - "--MT" = "- to Missing to Trace" "--N-" - "--N-" = "- to None" "--N1" - "--N1" = "- to None to 1+" "--N2" - "--N2" = "- to None to 2+" "--NM" - "--NM" = "- to None to Missing" "--NN" - "--NN" = "- to None to None" "--NO" - "--NO" = "- to None to Other" "--NT" - "--NT" = "- to None to Trace" "--O-" - "--O-" = "- to Other" "--O1" - "--O1" = "- to Other to 1+" "--O2" - "--O2" = "- to Other to 2+" "--OM" - "--OM" = "- to Other to Missing" "--ON" - "--ON" = "- to Other to None" "--OO" - "--OO" = "- to Other to Other" "--OT" - "--OT" = "- to Other to Trace" "--T-" - "--T-" = "- to Trace" "--T1" - "--T1" = "- to Trace to 1+" "--T2" - "--T2" = "- to Trace to 2+" "--TM" - "--TM" = "- to Trace to Missing" "--TN" - "--TN" = "- to Trace to None" "--TO" - "--TO" = "- to Trace to Other" "--TT" - "--TT" = "- to Trace to Trace" "-1--" - "-1--" = "- to 1+" "-1-1" - "-1-1" = "- to 1+ to 1+" "-1-2" - "-1-2" = "- to 1+ to 2+" "-1-M" - "-1-M" = "- to 1+ to Missing" "-1-N" - "-1-N" = "- to 1+ to None" "-1-O" - "-1-O" = "- to 1+ to Other" "-1-T" - "-1-T" = "- to 1+ to Trace" "-11-" - "-11-" = "- to 1+ to 1+" "-11M" - "-11M" = "- to 1+ to 1+ to Missing" "-11N" - "-11N" = "- to 1+ to 1+ to None" "-11O" - "-11O" = "- to 1+ to 1+ to Other" "-11T" - "-11T" = "- to 1+ to 1+ to Trace" "-12-" - "-12-" = "- to 1+ to 2+" "-12M" - "-12M" = "- to 1+ to 2+ to Missing" "-12N" - "-12N" = "- to 1+ to 2+ to None" "-12O" - "-12O" = "- to 1+ to 2+ to Other" "-12T" - "-12T" = "- to 1+ to 2+ to Trace" "-1M-" - "-1M-" = "- to 1+ to Missing" "-1M1" - "-1M1" = "- to 1+ to Missing to 1+" "-1M2" - "-1M2" = "- to 1+ to Missing to 2+" "-1MM" - "-1MM" = "- to 1+ to Missing to Missing" "-1MN" - "-1MN" = "- to 1+ to Missing to None" "-1MO" - "-1MO" = "- to 1+ to Missing to Other" "-1MT" - "-1MT" = "- to 1+ to Missing to Trace" "-1N-" - "-1N-" = "- to 1+ to None" "-1N1" - "-1N1" = "- to 1+ to None to 1+" "-1N2" - "-1N2" = "- to 1+ to None to 2+" "-1NM" - "-1NM" = "- to 1+ to None to Missing" "-1NN" - "-1NN" = "- to 1+ to None to None" "-1NO" - "-1NO" = "- to 1+ to None to Other" "-1NT" - "-1NT" = "- to 1+ to None to Trace" "-1O-" - "-1O-" = "- to 1+ to Other" "-1O1" - "-1O1" = "- to 1+ to Other to 1+" "-1O2" - "-1O2" = "- to 1+ to Other to 2+" "-1OM" - "-1OM" = "- to 1+ to Other to Missing" "-1ON" - "-1ON" = "- to 1+ to Other to None" "-1OO" - "-1OO" = "- to 1+ to Other to Other" "-1OT" - "-1OT" = "- to 1+ to Other to Trace" "-1T-" - "-1T-" = "- to 1+ to Trace" "-1T1" - "-1T1" = "- to 1+ to Trace to 1+" "-1T2" - "-1T2" = "- to 1+ to Trace to 2+" "-1TM" - "-1TM" = "- to 1+ to Trace to Missing" "-1TN" - "-1TN" = "- to 1+ to Trace to None" "-1TO" - "-1TO" = "- to 1+ to Trace to Other" "-1TT" - "-1TT" = "- to 1+ to Trace to Trace"

Page 7: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

The solution:The solution:

Page 8: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Lots of Pepsi ®!

Page 9: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Let SASLet SAS®® create the combinations AND the create the combinations AND the

meanings for them.meanings for them.

The Real Solution:

Page 10: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

The method:The method:

1.1. Create a data set with the individual values and Create a data set with the individual values and meanings. This will only consist of a very few records. meanings. This will only consist of a very few records. In our case, we had 7 values.In our case, we had 7 values.

2.2. Let SAS create all the combinations and put them into Let SAS create all the combinations and put them into a data set. We will cross the dataset with itself 3 times a data set. We will cross the dataset with itself 3 times to create the 4 positions. Remember the Cartesian to create the 4 positions. Remember the Cartesian product?product?

3.3. Post-process the dataset to account for baseline and Post-process the dataset to account for baseline and missing values.missing values.

4.4. Create the datasets from which we will create the Create the datasets from which we will create the permanent formats.permanent formats.

5.5. Write out the permanent formats.Write out the permanent formats.Step 1Step 1 step 2astep 2a step 2bstep 2b step 2cstep 2c step 3step 3 step 4astep 4a step 4bstep 4b step 5 step 5

Page 11: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Step 1Step 1

data work.temp;data work.temp; length x $1length x $1 y $7;y $7; x = 'T'; y = 'Trace'; output;x = 'T'; y = 'Trace'; output; x = '1'; y = '1+'; output;x = '1'; y = '1+'; output; x = '2'; y = '2+'; output;x = '2'; y = '2+'; output; x = 'O'; y = 'Other'; output;x = 'O'; y = 'Other'; output; x = 'M'; y = 'Missing'; output;x = 'M'; y = 'Missing'; output; x = '-'; y = '-'; output;x = '-'; y = '-'; output; x = 'N'; y = 'None'; output;x = 'N'; y = 'None'; output; run; run; outlineoutline

Page 12: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Step 2aStep 2a

proc sql;proc sql;

create table work.temp ascreate table work.temp as

select x, y from work.tempselect x, y from work.temp

order by x;order by x;

outlineoutline

Page 13: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Step 2bStep 2b

create table work.temp2 ascreate table work.temp2 as

select (a.x !! b.x) as x,select (a.x !! b.x) as x,

(a.y !! ' to ' !! b.y) as y(a.y !! ' to ' !! b.y) as y

from work.temp as a,from work.temp as a,

work.temp as b;work.temp as b;

outlineoutline

Page 14: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Step 2cStep 2c

create table work.temp3 ascreate table work.temp3 as

select (a.x !! b.x) select (a.x !! b.x)

as x length = 200,as x length = 200,

compbl(a.y !! ' to ' !! b.y)compbl(a.y !! ' to ' !! b.y)

as y length = 200as y length = 200

from work.temp2 as a,from work.temp2 as a,

work.temp2 as b;work.temp2 as b;

outlineoutline

Page 15: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Step 3Step 3

data work.temp3 (drop = to_);data work.temp3 (drop = to_);set work.temp3;set work.temp3;%* format these especially for baseline records;%* format these especially for baseline records; if substr(x, 2) EQ '---'if substr(x, 2) EQ '---' then y = scan(y, 1) !! " at baseline";then y = scan(y, 1) !! " at baseline";

%* eliminate "to -";%* eliminate "to -"; do while (index(y, "to -") GT 0);do while (index(y, "to -") GT 0); to_ = index(y, "to -") ;to_ = index(y, "to -") ; y = left(trim(substr(y, 1, (to_ - 1)) !!y = left(trim(substr(y, 1, (to_ - 1)) !!

substr(y, (to_ + 4))));substr(y, (to_ + 4)))); end;end; y = compbl(y);y = compbl(y);run;run;

outlineoutline

Page 16: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Step 4aStep 4a

data work.ctrl;data work.ctrl; length x y $200;length x y $200; length fmtname end $200;length fmtname end $200; set work.temp end = last;set work.temp end = last; retain fmtname 'cat' type 'c';retain fmtname 'cat' type 'c'; rename x = startrename x = start y = label;y = label; end = x;end = x;run;run;

outlineoutline

Page 17: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Step 4bStep 4b

data work.ctrl2;data work.ctrl2;

length x y $200;length x y $200;

length fmtname end $200;length fmtname end $200;

set work.temp3 end = last;set work.temp3 end = last;

retain fmtname 'cat_all' type 'c';retain fmtname 'cat_all' type 'c';

rename x = startrename x = start

y = label;y = label;

end = x;end = x;

run;run;outlineoutline

Page 18: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

Step 5Step 5

proc format library = library cntlin = work.ctrl;proc format library = library cntlin = work.ctrl;

run;run;

proc format library = library cntlin = work.ctrl2;proc format library = library cntlin = work.ctrl2;

run;run;

outlineoutline

Page 19: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

ConclusionConclusion

And that’s how I learned to And that’s how I learned to type 1,388,571 wpm !type 1,388,571 wpm !

Page 20: Creating Extensive Shift Tables OR How I Learned to Type 1,388,571 wpm! Kelley Weston.

And boy, am I tired !