Hi,
I would like to save a new dataset, eg USA.dta, by extracting from the variable 'bvd_id' the first two characters that refer to the ISO country code. In this example, 'US'. Ideally, I would like to automate this to capture all states that are in the master dataset.
Thanks,
Ciaran
I would like to save a new dataset, eg USA.dta, by extracting from the variable 'bvd_id' the first two characters that refer to the ISO country code. In this example, 'US'. Ideally, I would like to automate this to capture all states that are in the master dataset.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str18 bvd_id_number str3 consolidation_code str21 filing_type "PT503338435" "U1" "Local registry filing" "MA37163-81" "U1" "Local registry filing" "JP1011001052846" "LF" "Local registry filing" "FI10958757" "U1" "Local registry filing" "US115044924GN" "LF" "Local registry filing" end
Thanks,
Ciaran
Comment