Nick,
the data will look like this before the use of keep if command
item_code exp_val sales_val
6 75 .
1 100 6250
4 60 30
2 60 1
3 52 15
9 407 .
4 60 3
9 738
2 120 2
2 100 5
after using the keep if command and merging back
state_code_6 exp_val_6 sales_val_6 state_code_2 exp_val_2 sales_val_2
6 75 . 2 60 1
. . . 2 120 2
. . . 2 100 5
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/