Only need first 2 digits of a zip code

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Alex_vandeminne
Posts: 1
Joined: Tue Dec 07, 2010 3:58 am

Only need first 2 digits of a zip code

Postby Alex_vandeminne » Tue Dec 07, 2010 4:11 am

Dear all,

I want to generate a seperate variable which only contains the first two digits of an already given postcode (Dutch for zip code). For example: a case has '1017 AA' for the variable 'postcode', but needs a seperate variable (let's call it 'postcode_2') '10'. I usually do this in Excel (Data > text to columns), but there are 1.7 milion cases (too big for clipboard). Is there a way to generate this in Eviews?

Thank you,
Alex

PS: using eviews 6

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Only need first 2 digits of a zip code

Postby EViews Gareth » Tue Dec 07, 2010 6:57 am

Series firsttwo = @Val(@left(postcode,2))


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests