Question on decimal and integer setting on DSS API

Regarding the default data type for two fields that we are calling on the Datascope API. The Accumulated Volume Unscaled and Open Interest fields, we are currently configured to consume these are decimals. However, my understanding of these fields and the responses that we receive via the Datascope API requests, suggest that they should be integers. If we were to change this request so that we call just for integers, do you see there being any issues with this? What would happen if the fields were represented as a decimal, but we coded to only consume integers, would this return a null value, or would it truncate?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @rishabh.nahata

    According to the DataScope Select Data Content Guide, the type of Accumulated Volume Unscaled and Open Interest fields are numeric with decimal points.

    image

    However, from their definitions, they look like to be integers. Therefore, you need to directly contact the DSS support team via MyRefinitiv to verify that the Accumulated Volume Unscaled and Open Interest fields can have decimal points.

    image

    For converting those fields to integers, the behavior should depend on the programming languages.

    For example, if I use C# with the DSS .NET library to extract EndOfDayPricingExtractionRequest, the values are returned as objects.

    foreach (KeyValuePair<string, object> item in row.DynamicProperties)
    {
        if(item.Key == "Universal Close Price")
        {
            int temp = Convert.ToInt32(item.Value);
            Console.WriteLine(temp);
        }
    }

    Then, if I convert the object to an integer by using Convert.ToInt32(item.Value), the returned integer will be rounded. For example:

    Object => Integer
    108.91 => 109
    46.25 => 46
    103.5 => 104
    null => 0

Answers

  • zoya faberov
    zoya faberov ✭✭✭✭✭

    Hello @rishabh.nahata,

    It would help to know, which request type you use.

    Per specific request type, you can request all available content fields, with their type. For example, we request and examine fieldtypes for EndOfDayPricing:

    {{protocol}}{{host}}{{api}}Extractions/GetValidContentFieldTypes(ReportTemplateType=ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ReportTemplateTypes'EndOfDayPricing'

    You should process the field result according to the field type, if I understand your question correctly.