125 data work.new;
126 length word $7;
127 amount = 7;
128 if amount = 5 then word = 'CAT';
129 else if amount = 7 then word = 'DOG';
130 else word = 'NONE!!!';
131 amount = 5;
NOTE: The data set WORK.NEW has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.00 seconds
The third statement of the program, amount = 7; will set a value of 7 for the variable amount. The else condition, else if amount = 7 then word = 'DOG'; will be TRUE and set a value of 'DOG' for the variable word. The statement, amount = 5; will overwrite the value of variable amount in the PDV by 5. Thus, the final values for amount is 5 and for word is 'DOG'.
The one and only FREE resource for general SAS online training as well as study guides for the SAS Base Certification. My goal is to create the SAS Certification prep guide that I never found but always wanted. This should also be a place to come if you are new to the language but are simply looking for online SAS training.