looping to create series names
Posted: Mon Feb 09, 2009 7:29 am
Hi,
I am trying to to make a loop where the name of the series is looped by an alpha series for the series names and a group for definition of the series. I can get the second half of this to work, but I am unable to find a way for the series names themselves to loop. Basically, I want to create a bunch of series prwds_*, prwdh_*, etc where * is iso country codes for about 62 countries. Here is an example of what I am trying:
for !j=1 to 62
series prpws_isocode(!j)= prpws_usd(!j) *xr_us(!j)
series prpwh_isocode(!j)= prpwh_usd(!j) *xr_us(!j)
series prchs_isocode(!j)= prchs_usd(!j) *xr_us(!j)
series prchh_isocode(!j)= prch_usd(!j) *xr_us(!j)
where isocode is my alpha series containing br, cl, etc
prpws_usd is a group containing pws_br, pws_cl, etc
xr_us is a group containing xrbrus, xrclus, etc
and the groups are all alphabatized by the country code, so the same element (ex: 3rd) in each group (or isocode series) all refer to the same country
Obviously, I know I can write out all 248 (62*4) series names by hand and just loop for the RH side, but I would really prefer to avoid this at all costs from both a time and an ability to change easily standpoint. Thanks for any help!
I am trying to to make a loop where the name of the series is looped by an alpha series for the series names and a group for definition of the series. I can get the second half of this to work, but I am unable to find a way for the series names themselves to loop. Basically, I want to create a bunch of series prwds_*, prwdh_*, etc where * is iso country codes for about 62 countries. Here is an example of what I am trying:
for !j=1 to 62
series prpws_isocode(!j)= prpws_usd(!j) *xr_us(!j)
series prpwh_isocode(!j)= prpwh_usd(!j) *xr_us(!j)
series prchs_isocode(!j)= prchs_usd(!j) *xr_us(!j)
series prchh_isocode(!j)= prch_usd(!j) *xr_us(!j)
where isocode is my alpha series containing br, cl, etc
prpws_usd is a group containing pws_br, pws_cl, etc
xr_us is a group containing xrbrus, xrclus, etc
and the groups are all alphabatized by the country code, so the same element (ex: 3rd) in each group (or isocode series) all refer to the same country
Obviously, I know I can write out all 248 (62*4) series names by hand and just loop for the RH side, but I would really prefer to avoid this at all costs from both a time and an ability to change easily standpoint. Thanks for any help!