In your second row, you have two values for "var1". How do you want to handle such an occurrence? First value, last value, or do you want to output a separate observation for each value? In the latter case, what do you want to do with the other name/value pairs in the same input line?
It would be helpful if you posted the expected dataset from your input data.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.