The SASEQUAN Interface Engine

Example 50.6 Transforming Data for the JASDAQ-TOP20 Exchange Traded Fund (ETF)

This example shows how to transform the daily data by using the diff transformation and the same Quandl code as in Example 50.4 and Example 50.5, GOOG/TYO_1551, to retrieve the price and yield performance of the JASDAQ-TOP20 Exchange Traded Fund (ETF) in Japan. Specify a range by using START='2014-01-01' and END='2014-03-26', a transformation function by using TRANS=DIFF, and a collapse frequency by using COLLAPSE=WEEKLY. The output is shown on Output 50.6.1.


options validvarname=any;

title 'JASDAQ-TOP20 ETF, TRANS=DIFF Option';
libname _all_ clear;
libname mylib "U:\quan950\doc\";

libname myTOP20 sasequan "%sysget(QUANDL)"
   apikey='XXXXXXXXXXXXXXXXXXXX'
   idlist='GOOG/TYO_1551'
   format=XML
   outXml=jasdaqX
   automap=replace
   mapref=MyMap
   xmlmap="%sysget(QUANDL)jasdaqX.map"
   start='2014-01-01'
   end='2014-03-26'
   collapse=weekly
   trans=diff
   ;

data mylib.jasdaqX;
   set myTOP20.jasdaqX;
run;
proc contents data=mylib.jasdaqX; run;
proc print data=mylib.jasdaqX; run;

Output 50.6.1: JASDAQ-TOP20 ETF, Weekly Data with TRANS=DIFF

JASDAQ-TOP20 ETF, TRANS=DIFF Option

Obs date Open High Low Close Volume
1 2014-01-19 -240 -180 -210 -100 -5850
2 2014-01-26 -90 40 -150 -80 15120
3 2014-02-02 -40 -230 -150 -300 -14810
4 2014-02-09 -110 -120 0 -30 -370
5 2014-02-16 -10 0 -70 -70 -1080
6 2014-02-23 40 70 160 120 1560
7 2014-03-02 130 60 10 30 -4130
8 2014-03-09 40 60 200 180 -680
9 2014-03-16 -320 -270 -430 -380 5290
10 2014-03-23 -250 -280 -290 -330 -4250
11 2014-03-30 -440 -330 -280 -190 4320