I am trying to create a new variable (called Payment_YearMonth) in each observation related to the value stored in YearMonth in each observation and store Amount as that variable's value.
Thanks so much, I tried sorting the data first by the BY variable but SAS is saying the ID value occurs twice in the same BY group. Do you know why that might be? Kind regards
Only you know your data. You might need to add a new variable to use for the BY grouping. In your original example it looked like you wanted one output observation per input observation. data for_transpose; row+1; set have; run; proc transpose data=for_transpose out=want; by row; ...
Then within PROC TRANSPOSE, change the BY statement:
by rec;
Do not change the ID statement.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and lock in 2025 pricing—just $495!