Hi,
I am attempting to write a SPSS syntax which allows me to match region and state (created variables) based on postcode (input variable).
I have a list of all postcodes in Australia, together with region and state, similar to the table below.
Postcode |
Region |
State |
2000 |
Sydney |
New South Wales |
3000 |
Melbourne |
Victoria |
4000 |
Brisbane |
Queensland |
I will on a regular basis receive datafiles that only contain postcode. Based on the postcode I want to create a syntax that autofill name of the region and state. I could merge datafiles but prefer to have everything in a syntax file. Is there an IF statement that allows me to alter more than one variable at a time?
Something like the one below:
Alter type POSTCODE (F10).
String REGION STATE (A50).
If (POSTCODE=2000) REGION="Sydney", STATE="New South Wales'.
If (POSTCODE=3000) REGION="Melbourne', STATE="Victoria".
If (POSTCODE=4000) REGION="Brisbane', STATE="Queensland".
Etc.
Any suggestions on how to do this?
Kind regards,
Amanda
------------------------------
Amanda
------------------------------