For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
1 0 0 1

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?

dss-rest-apidatascope-selectdss
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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.

1 Answer

· Write an Answer
Upvotes
Accepted
77.5k 242 52 72

@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.

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.

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

1604046336592.png (45.2 KiB)
1604047183692.png (16.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.