I'm looking to transform some data where we have a group of question/answer sections for different options. The basic format is as such:
123
FavoriteColor
blue
FavoriteFood
pizza
There can be a large list of questions/answers but what I really want to do is setup a datasaet with id, FavoriteColor, and FavoriteFood variables. Can I setup the path in an XML map which basically says something such as:
person/qa[question='FavoriteFood']/answer
person/qa[question='FavoriteColor']/answer
Data should look like:
ID FavoriteFood FavoriteColor
123 pizza blue
When I attempt something similar to this in the SAS XML mapper I get no value. Is this even possible to do within a .map file?
I could possibly transpose this via PROC TRANSPOSE, but I am really only interested in mapping a few key values.
Thoughts or suggestions?