Snippets

DavidC bbgdl-demo

Created by David Cuddihy

File bbgdl-demo Added

  • Ignore whitespace
  • Hide word diff
+# Here's an example of using the bbgdl tools to perform
+# ad-hoc fetches of Bloomberg Datalicense data.
+use bbruntime
+use bbthyme
+
+cat > xxx <<EOF
+SPVXSTR Index
+SX5E Index
+MLT1US10 Index
+NDUEEGF Index
+BCRIUU5E Index
+BCRIUU5H Index
+EOF
+
+# Make a request file.
+bbgdl-make-gethistory-request 20150801 20150901 < mktids > rq
+
+# Post it
+bbgdl-put < rq
+
+
+# Wait for the response to arrive
+REPLYFILENAME=$(grep REPLY rq | cut -d= -f2)
+bbgdl-ls | grep $REPLYFILENAME
+# ..repeat til you see the xxxxx.gz file
+# (See also the datalicense_poll function in libdatalicense.sh)
+
+# Fetch it.
+bbgdl-get ./${REPLYFILENAME}.gz | bbgdl-decrypt > rawdata 
+
+# Turn it into a nice CSV
+bbgdl-raw-to-tvfd < rawdata > tvfd
+
+# Inspect
+cat tvfd
+
+
+
+
+
+
+
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.