RblUpload: Upload a request file to Bloomberg

Description Usage Arguments Value Examples

View source: R/core.R

Description

Upload a request file to query Bloomberg. A response file will be generated by Bloomberg. The request file can be user-defined following the Bloomberg Data License documentation or generated with the RblRequestBuilder function. The response file needs to be downloaded (see RblDownload) and parsed (see RblParse) to import the data in R.

Usage

1
2
3
4
5
RblUpload(
  RblRequest,
  filename = format(Sys.time(), "%m%d%H%M%S"),
  verbose = TRUE
)

Arguments

RblRequest

character string representing the request file according to Bloomberg Datalicense documentation. Can be generated with the RblRequestBuilder function

filename

name assigned to the remote file. Only alphanumeric characters and underscores are allowed. Invalid characters are removed.

verbose

logical. Should R report extra information on progress?

Value

A list with components

req

the request filename

out

the response filename

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
# Run RblConnect first

# Build a request file to download the daily closing prices of 
#  EURO STOXX Index from 2005-01-01 to 2015-12-31.
RblRequest <- 
     RblRequestBuilder(
          header = c(FIRMNAME = RblUser(), 
                     PROGRAMNAME = 'gethistory', 
                     DATERANGE = '20050101|20151231'),
          fields = c('PX_LAST'), 
          identifiers = c('SXXE Index')
     )
                                
# Upload the request file
req <- RblUpload(RblRequest)
req

## End(Not run)

RblDataLicense documentation built on July 30, 2021, 1:06 a.m.