Very similar to what Astounding just said, but I'd add the space character into the scan delimiter listing as well just to confirm that the space doesn't offset our numbers. Here's my thought process to help you understand the code in another way:
Last_Name = SCAN(name, 1, ",");
First_Middle = SCAN(name, 2, ", ");
First_Name = SUBSTR(First_Middle, 1, LENGTH(First_Middle)-2);
Middle_Init = SUBSTR(First_Middle, LENGTH(First_Middle)-1, 2);
Last name is easiest to grab; you've already got that. Then you can take the cluster of First and Middle initials together. First name is the substring of everything EXCEPT those last two characters, middle initials are ONLY the last two characters. (These assignments should also be inside a data step, to be clear)
... View more