I am using the FETCH command in a loop. I encounter problems because some of the fields for which historical requests are made are unsupported. For instance, using the 'INDX_MEMBERS' field with FETCH:
fetch(connect,'S5FINL Index','History','INDX_MEMBERS')
returns the error:
??? Error using ==> bloomberg.fetch at 450 No historical data was returned. Field list may contain entry that is invalid for historical data requests.
I am well aware of this, but I would like to make the FETCH function not return an error but a NaN when it comes across a bad field. This way my program can continue to loop even if the fields are not available.
Best Answer