I am working with a dataset with a 24hr dietary recall. Each participant has multiple items of food for which they answered a yes/no question if it was consumed at a fast food restaurant. I want to sort this data by participant ID so I can end up with a dichotomous variable for each participant (1 = consumed fast food in last 24 hours, 2 = did not consume fast food in last 25 hours). Does anyone know the syntax to do this so it is sorted by participant ID (even though each participant has multiple food entries?). I am open to using other software but would ideally do this in SPSS or SAS. Thank you!