seeking help in coding locations in working data file using a global list

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

seeking help in coding locations in working data file using a global list

thara vardhan-2

Dear List Members

I would be grateful if any member could help me in coding the location as a numeric code in my data file from a global list of codes (created in an alphabetical order).

Using the auto recode function I converted the string variable 'finalpremise' into a numeric as ffpremise and then computed a masterlist of ABSNCSU code in an alphabetical order.        

Masterlist file:

 Finalpremise                                ABS      FF
                                                            NCSU   Premise
                                                            code        
ADULT ENTERTAINMENT                   380        1
AGED HOME CARE                                112        2
AIR                                                         260        3
AIRCRAFT                                              242        4
AIRPORT                                               241        5
AIRPORT                                               241        5
AMBULANCE STATION                             241        6
AMPITHEATRE                                   380        7
AMUSEMENT PARK                                380        8
ANCHORAGE                                     260        9
ANIMAL TRAP                                   399        10
APIARY EQUIPMENT                              399        11
AQUACAB                                               242        12
AQUACAB                                               242        12
ART & CRAFT                                   339        13
ART GALLERY                                   339        14
ART GALLERY (EXCL RETAIL)             380        15
BABY HEALTH CENTRE                            220        16
BALCONY                                               120        17
BANK                                                  320        18
BARBER                                                339        19
BARN                                                  370        20
BAY                                                   260        21
BEACH                                                 260        22
BEACH PARKING AREA                            260        23
BEAUTY SALON                                  339        24
BILLABONG                                             260        25
BLOCK OF UNITS (1 TO 4 FLOORS)        111        26
BLOCK OF UNITS (OVER 4 FLOORS)        111        27
BOARDING HOUSE                                112        29
BUSH HUMPY                                    111        46

My data file has the variable 'finalpremlist' as follows:    

finalpremlist
BLOCK OF UNITS (1 TO 4 FLOORS)  
BLOCK OF UNITS (1 TO 4 FLOORS)
BOARDING HOUSE                
BUSH HUMPY                    
BUSHLAND/SCRUB                
BOARDING HOUSE                
BUSH HUMPY                    

How do I apply the codes from the masterlist to my work file? I tried to use match file function but did not succeed.

I want to learn if there is a more efficient way of doing this rather than  autorecode each file and write syntax in.
I have several data files and for each incident type I have to generate the relevant list of ABSNCSU codes.

many thanks
regards
Thara Vardhan
Senior Statistician
Performance Improvement & Planning
NSW Police
Tel: (02) 8835-8526



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

The information contained in this email is intended for the named recipient(s) 
only. It may contain private, confidential, copyright or legally privileged 
information.  If you are not the intended recipient or you have received this 
email by mistake, please reply to the author and delete this email immediately. 
You must not copy, print, forward or distribute this email, nor place reliance 
on its contents. This email and any attachment have been virus scanned. However, 
you are requested to conduct a virus scan as well.  No liability is accepted 
for any loss or damage resulting from a computer virus, or resulting from a delay
or defect in transmission of this email or any attached file. This email does not 
constitute a representation by the NSW Police Force unless the author is legally 
entitled to do so.