I'm trying to loop through two strings in order to download series via Macrobond but can't figure out how to get the quotations marks and spaces correctly.
So for example, instead of:
fetch(d=mb) "ih:bl:ussw2 bgn curncy" "ih:bl:cdsw2 bgn curncy" "ih:bl:ussw5 bgn curncy" "ih:bl:cdsw5 bgn curncy" "ih:bl:ussw10 bgn curncy" "ih:bl:cdsw10 bgn curncy"
I am trying to do something like:
%BBG_swaps = "ussw cdsw"
%BBG_matyr = "2 5 10"
%bbg_start ="ih:bl:"
%bbg_fxend = " bgn curncy "
for %i {%BBG_swaps}
for %j {%BBG_matyr}
fetch(d=mb) {%bbg_start}{%i}{%j}{%bbg_fxend}
next
next
But from what I can tell of the error message, that seems to want to put a quote around the entire fetch command like:
"fetch(d=mb) "ih:bl:ussw2 bgn curncy"
Is there way to program this?
Thanks
Looping in Fetch command
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Looping in Fetch command
What you are doing looks like it should work.
Re: Looping in Fetch command
When I run it I get the error message:
2 Objects were not found: MB::IH:BL:USSW2 MB::CURNCY in "FETCH(D=MB) IH:BL:USSW2 BGN CURNCY".
2 Objects were not found: MB::IH:BL:USSW2 MB::CURNCY in "FETCH(D=MB) IH:BL:USSW2 BGN CURNCY".
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Looping in Fetch command
Try this:
Code: Select all
for %i {%BBG_swaps}
for %j {%BBG_matyr}
%term = %bbg_start + %i + %j + %bbg_fxend
fetch(d=mb) %term
next
next
Re: Looping in Fetch command
That worked like a charm. Thanks!
Who is online
Users browsing this forum: No registered users and 2 guests
