Let's focus on the code, "input @1 height 2. @4 weight 2;", in which the number 2 after 'weight' means thet SAS would read and put the second character into 'weight' only.
And furthermore, if we write in this way, "input @1 height 2. @4 weight 1;", the value of 'weight' in dataset 'a' would be 7.