Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65580

Listing observations and then saving them into a string variable

$
0
0
Hello dear forum members,

I am seeking your help with the following task.

So, I have a list of MSA (metropolitan statistical area) codes (N=104) and also a list of corresponding ZIP codes (N="a lot"). I use the following command to list ZIP codes that fall under a given MSA:

HTML Code:
 list ZIPCODE if msa == 10420, noobs clean

    ZIPCODE  
      44056  
      44067  
      44087  
      44201  
      44202  
      44203  
      44210  
      44211  
      44216  
      44221  
      44222  
      44223  
      44224  
      44231  
      44232  
      44234  
      44236  
      44237  
      44238  
      44240  
      44241  
      44242 
I further need to save the observed ZIP codes for each MSA into a new string in the following format "44056, 44067, 44087, ..., 44242".

Could you please suggest a code to execute such task.

Thankfully,
Anton

Viewing all articles
Browse latest Browse all 65580

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>