What inspired this wish list request?
Trying to copy the script created by Recode and realizing that it is not even close what I could achieve with JSL and simple functions already provided by JMP.
What is the improvement you would like to see?
Update the methods used in Recode to utilize more modern methods. There are many examples of this but here is one using value codes (the "issue" generally happens when Recode starts relaying on the Map Values and you end up with all hard-coded values)
Will create messy code
// Recode column: name
Local({dt},
dt = Data Table("Big Class");
dt << Begin Data Update;
dt << Recode Column(
dt:name,
{Num(_rcNow), Map Value(
_rcOrig,
{"ALFRED", 1, "ALICE", 2, "AMY", 3, "BARBARA", 4, "CAROL", 5, "CHRIS", 6,
"CLAY", 7, "DANNY", 8, "DAVID", 9, "EDWARD", 10, "ELIZABETH", 11,
"FREDERICK", 12, "HENRY", 13, "JACLYN", 14, "JAMES", 15, "JANE", 16,
"JEFFREY", 17, "JOE", 18, "JOHN", 19, "JUDY", 20, "KATIE", 21, "KIRK",
22, "LAWRENCE", 23, "LESLIE", 24, "LEWIS", 25, "LILLIE", 26, "LINDA", 27,
"LOUISE", 28, "MARION", 29, "MARK", 30, "MARTHA", 31, "MARY", 32,
"MICHAEL", 33, "PATTY", 34, "PHILLIP", 35, "ROBERT", 36, "SUSAN", 37,
"TIM", 38, "WILLIAM", 39},
Unmatched(_rcNow)
)},
Update Properties(1),
Target Column(:name)
);
dt:name << Remove Value Labels;
dt:name << Value Labels(
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39},
{"ALFRED", "ALICE", "AMY", "BARBARA", "CAROL", "CHRIS", "CLAY", "DANNY",
"DAVID", "EDWARD", "ELIZABETH", "FREDERICK", "HENRY", "JACLYN", "JAMES",
"JANE", "JEFFREY", "JOE", "JOHN", "JUDY", "KATIE", "KIRK", "LAWRENCE",
"LESLIE", "LEWIS", "LILLIE", "LINDA", "LOUISE", "MARION", "MARK", "MARTHA",
"MARY", "MICHAEL", "PATTY", "PHILLIP", "ROBERT", "SUSAN", "TIM", "WILLIAM"}
);
dt << End Data Update;
);
when it could be done with single line (since JMP17):
dt:name << Labels to Codes;
Example of the methods which are difficult to utilize outside of recode are group similar values
And we will end up with Map Value instead of nice "grouping" script
Names Default To Here(1);
Local({dt},
dt = Data Table("Big Class");
dt << Begin Data Update;
For Each Row(
dt,
dt:name[] = Map Value(dt:name, {"MARY", "MARK"}, Unmatched(dt:name))
);
dt << End Data Update;
);
I can write script to do this myself (and I have done it) but would be great that it was easily exposed to users via JMP created script.
Why is this idea important?
Users are able to capture more efficient code with less hard-coded values
... View more