Hi,
I would like to import data from the BLS ftp site into eviews but I don't know how to transpose the data to get it in to a monthly workfile.
the ftp is ftp://ftp.bls.gov/pub/time.series/sm/sm.data.9.dc
Below is a sample of the ftp file. When the data gets to the end of the time frame (2010 m06), a new series begins.
series_id year period value footnote_codes
SMS11000000000000001 1990 M01 687.8
SMS11000000000000001 1990 M02 689.6
SMS11000000000000001 1990 M03 691.4
If there is another source for not-seasonally adjusted state and metro employment data, I'd be interested in that too. FRED only has seasonally adjusted.
Thanks,
Norton
importing flat file from ftp
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
tchaithonov
- Posts: 168
- Joined: Mon Apr 13, 2009 7:39 am
- Location: New York City
Re: importing flat file from ftp
How about importing it into Excel and do text-to-column? I am not sure if you have a lot of files or not but if it's just one, this should be the fastest method.
-
EViews Jason
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: importing flat file from ftp
In the data, 'M13' is listed as a period value. How do you wish to handle the observations for those periods?
-
EViews Jason
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: importing flat file from ftp
This will get you most of the way there ignoring the M13 issue.
Code: Select all
wfopen "ftp://ftp.bls.gov/pub/time.series/sm/sm.data.9.dc" colhead=1 firstobs=1
alpha serid = @replace(series_id,"00","") 'shorten series names otherwise unstacking will complain about the names being too long
alpha date = @str(year) + " " + period
pageunstack(namepat="?*") serid date @ value
Re: importing flat file from ftp
Thanks for the code. I think I can work through the M13 issue new that I can pull it in. The M13 is the annual data but they appear to be NAs so it should be easy to cycle through.
Who is online
Users browsing this forum: No registered users and 1 guest
