I am interested in creating new rows is SAS that are conditional on specific variables.
Suppose these are the names of the columns RecordID, ItemName, ItemCount, ItemX, ItemY, ItemZ.
ItemX, ItemY, and ItemZ are numeric variables that can be equal to or greater than 0.
When ItemX, ItemY, and/or ItemZ holds a value greater than 0, I want a new row to be created where ItemName contains the variable name (ItemX, ItemY, ItemZ) and ItemCount to contain the numeric value.
For example, if RecordNumber=1 has ItemX=5 and ItemY=10, then ItemName=ItemX and ItemCount=5 will appear in a new row. ItemName=ItemY and ItemCount=10 has its own row.
How should I go about this in SAS? Thanks.