Hello,
I'm having trouble with making a new variable that will count the 'correct' answers in the first 17 questions on a survey. Whenever I use this code:
Data HW4set;
If 1 = p1p then Correct=correct+1;
If 1 = p2p then Correct=correct+1;
Run;
It just deletes all the data from the set. It turns the set from this:
![Diana___0-1601253013600.png Diana___0-1601253013600.png](https://communities.sas.com/t5/image/serverpage/image-id/49847i30A9A8A9A9B4C65B/image-size/medium?v=v2&px=400)
to this:
![Diana___1-1601253071683.png Diana___1-1601253071683.png](https://communities.sas.com/t5/image/serverpage/image-id/49848iD7958626814B5CE3/image-size/medium?v=v2&px=400)
Which I don't understand, it hasn't worked with various attempts, and it won't even make a variable that is constant such as:
DATA HW4set;
Always6=6;
Run;
It just erases the data set again, even though I got it straight from an example. There are no errors displayed either, it only says that p1p and p2p are uninitialized.