Looping in Fetch command
Posted: Mon Nov 11, 2013 10:10 am
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
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