02-15-2015 06:08 PM
Can anyone tell me what would be the code for creating multiple dataset from one dataset in one data step?
Example: I have the following info dataset
Name City Country
John New York USA
Albert Toronto Canada
Alice Sydney Australia
I want to create 3 dataset called USA, Canada and Australia from info dataset above. I tried the following way, but it's not working:
data usa canada australia;
if country='usa' then output usa;
if country='Canada' then output Canada;
if country='Australia' then output Australia;
can anyone help please. Thanks.
02-17-2015 02:29 PM
Here's an article that I wrote recently:
Be sure to read the comments, as several other experts have weighed in with improvements.
02-17-2015 02:46 PM
I seem to recall someone already answering this last week. One of your records shows the country as USA, but your if statement is looking for usa.
02-17-2015 03:10 PM