Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str29 salary_today
"243,250 (307,840) (253,454)"  
"322,043 (342,970)"            
"279,102 (365,736)"            
"126,025[12]"                  
"247,579††"                
"166218"                       
"138,740†††"             
"161349"                       
"130,646 (204,309)"            
"254160"                       
"238908"                       
"129,517 (175,081)***‡‡‡"
"228190"                       
"117763"                       
""                             
"188,723"                      
"135586"                       
"161,349 (197,454)"            
"162056"                       
end
The variable salary_today looks like the following
Code:
. list

     +-----------------------------+
     |                salary_today |
     |-----------------------------|
  1. | 243,250 (307,840) (253,454) |
  2. |           322,043 (342,970) |
  3. |           279,102 (365,736) |
  4. |                 126,025[12] |
  5. |                   247,579†† |
     |-----------------------------|
  6. |                      166218 |
  7. |                  138,740††† |
  8. |                      161349 |
  9. |           130,646 (204,309) |
 10. |                      254160 |
     |-----------------------------|
 11. |                      238908 |
 12. |     129,517 (175,081)***‡‡‡ |
 13. |                      228190 |
 14. |                      117763 |
 15. |                             |
     |-----------------------------|
 16. |                     188,723 |
 17. |                      135586 |
 18. |           161,349 (197,454) |
 19. |                      162056 |
     +-----------------------------+
I want to generate four variables salary, salary_p1, salary_p2, and salary_note : salary will contain the numbers before parenthesis; salary_p1 will contain the numbers between the first two parentheses; salary_p2 will contain the numbers between the last parentheses ; salary_note will contain all the symbols ( including [12] in observation 4).

For example, for observation 12 salary will be 129517, salary_p1 will be 175081, salary_p2 will be missing , and salary_note will be ***‡‡‡.