|
Dear List members I have a variable by polregx with the following information polregx NSW - Ashfield NSW - Eastern Beaches NSW - Bankstown NSW - Blue Mountains NSW - Brisbane Water I want to remove the first 3 letters and the - for instance NSW-Eastern Beaches should read as only Eastern beaches. I tried by computing a new string variable with concat function but get an error message as follows. string region (a20). compute region =concat (substr (polregx, 1,4)). >Error # 4311 in column 45. Text: ) >The string argument required for the function specified was not supplied. >This command not executed. exe. I tried to do it this way too but I get the same message string fn (A20). compute fn = concat(polregx, ' ', ' ', ' '). execute. >Error # 4311 in column 43. Text: ) >The string argument required for the function specified was not supplied. >This command not executed. execute. Can any one please tell me where am I going wrong? Many thanks regards Thara Vardhan Senior Statistician Performance Improvement & Planning
|
|
If you look at the definition for CONCAT you will see it ‘adds’ strings together to create a single one. You were part way there with your first attempt,
try this ( untested ) STRING REGION (A20) COMPUTE REGION = SUBSTR ( polregx, 7, 20 ) This ‘chops out’ 20 characters from polregx, starting at the 7th character ( ‘NSW – ‘ = 6 characters )- hope this helps. Best Wishes John S. Lemon DIT ( Directorate of Information Technology ) - Student Liaison Officer Edward Wright Building: Room G51 Tel: +44 1224 273350 Fax: +44 1224 273372 From: SPSSX(r) Discussion [mailto:[hidden email]]
On Behalf Of Thara Vardhan
The University of Aberdeen is a charity registered in Scotland, No SC013683. |
| Free forum by Nabble | Edit this page |
