Hello everyone,
I've a dataset where I need to extract the zip code from the following three columns ( for each rf_id the zip code could be in any of the following three columns of address ). Is there a way for each observation in my dataset. The record_dt variable indicates date variable.
how can I extract the zip code for each observation from the following three columns of address? Would greatly appreciate any kind direction!
I've a dataset where I need to extract the zip code from the following three columns ( for each rf_id the zip code could be in any of the following three columns of address ). Is there a way for each observation in my dataset. The record_dt variable indicates date variable.
how can I extract the zip code for each observation from the following three columns of address? Would greatly appreciate any kind direction!
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long rf_id int record_dt strL(caddress_2 caddress_3 caddress_4) 12800340 12782 "60 STATE STREET" "SUITE 510" "BOSTON, MA 02109" 36250888 7003 "P.O. BOX 3511 STATION C" "OTTAWA ONTARIO CANADA K1Y 4H7" "" 36340874 7000 "345 CALIFORNIA STREET" "SAN FRANCISCO, CA 94104-2675" "" 36340875 7000 "100 GALLERIA PARKWAY, STE. 1500" "ATLANTA, GA 30339" "" 36920537 7208 "COOKEVILLE, TN 38501" "" "" 36960452 7223 "235 EAST 42ND STREET" "NEW YORK, NEW YORK 10017-5755" "" 37290735 7332 "SUITE 3400" "SAN FRANCISCO, CA 94111-4187" "" 37370606 7348 "NEW YORK, NY 10022" "" "" 37410900 11040 "WASHINGTON, DC 20004" "" "" 37650757 7439 "1400 K STREET , N.W." "WASHINGTON, D.C. 20005" "" 37880668 7532 "PASADENA, CA 91101" "" "" 37880670 7532 "6633 CANOGA AVE." "CANOGA PARK, CA 91304" "" 37880673 7522 "WASHINGTON, D.C. 20036" "" "" 37880675 7522 "530 FIFTH AVE." "NEW YORK, N. Y. 10036" "" 37880676 7522 "1800 PRUDENTIAL PLAZA" "CHICAGO, IL 60601" "" 37880677 7522 "1350 AVENUE OF THE AMERICAS" "NEW YORK, N. Y. 10019" "" 37880680 7522 "1776 K ST. N.W." "WASHINGTON, D. C. 20006" "" 37880681 7522 "CHICAGO, IL 60603" "" "" 37880682 7522 "" "" "" 37880683 7522 "READINESS COMMAND" "5001 EISENHOWER AVE." "ALEXANDRIA, VA. 22333" 37880684 7522 "COMM." "5001 EISENHOWER AVE." "ALEXANDRIA, VA. 22333" end format %td record_dt
Comment