In another article we have seen how to dump static data of ADOs with ac_dump_ado.pl.
Here we are looking at timeseries and the corresponding tool dumpdata.
You could just pipe ADO IDs into dumpdata without any further parameters:
acdba@acbox:~$ echo C0.ISS.1 | dumpdata
+++WARNING+++ 20190419_16:45:39 @(#)dumpdata[7.3/$Revision: 46448 $]: Could not dump datafile for symbol C0.ISS.1, tree BLOOMBERG_CORRECTIONS (error 35)
+++WARNING+++ 20190419_16:45:39 @(#)dumpdata[7.3/$Revision: 46448 $]: Could not dump datafile for symbol C0.ISS.1, tree BLOOMBERG_DATA (error 35)
+++WARNING+++ 20190419_16:45:39 @(#)dumpdata[7.3/$Revision: 46448 $]: Could not dump datafile for symbol C0.ISS.1, tree BLOOMBERG_HISTORY (error 35)
+++WARNING+++ 20190419_16:45:39 @(#)dumpdata[7.3/$Revision: 46448 $]: Could not dump datafile for symbol C0.ISS.1, tree BLOOMBERG_TICKS (error 35)
+++INFO+++ 20190419_16:45:39 @(#)dumpdata[7.3/$Revision: 46448 $]: Dumping CONSOLIDATION_C0:C0.ISS.1...
CONSOLIDATION_C0,C0.ISS.1,F,A,0,-1,1,5,2,32,3,3,0,1,2622,4,100,5,0,6,52,8,-1,10,0,11,0,12,0,13,0,15,0,16,0,27,0,28,0,32,0,7,"no_change('C0#TS001',1);"
CONSOLIDATION_C0,C0.ISS.1,D,A,20180319,235959,2622,123.5,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180320,235959,2622,247,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180321,235959,2622,494,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180322,235959,2622,988,1
+++WARNING+++ 20190419_16:45:39 @(#)dumpdata[7.3/$Revision: 46448 $]: Could not dump datafile for symbol C0.ISS.1, tree TERRAFINO (error 35)
acdba@acbox:~$
You can see from the output above that dumpdata cycles through all the datafile trees in the system and tries to print the timeseries in AMDPR format. In some cases, that clearly fails.
So, let’s be more specific about what we ask for by supplying the datafile tree we are actually interested in:
acdba@acbox:~$ echo C0.ISS.1 | dumpdata CONSOLIDATION_C0
+++INFO+++ 20190419_16:46:15 @(#)dumpdata[7.3/$Revision: 46448 $]: Dumping CONSOLIDATION_C0:C0.ISS.1...
CONSOLIDATION_C0,C0.ISS.1,F,A,0,-1,1,5,2,32,3,3,0,1,2622,4,100,5,0,6,52,8,-1,10,0,11,0,12,0,13,0,15,0,16,0,27,0,28,0,32,0,7,"no_change('C0#TS001',1);"
CONSOLIDATION_C0,C0.ISS.1,D,A,20180319,235959,2622,123.5,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180320,235959,2622,247,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180321,235959,2622,494,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180322,235959,2622,988,1
acdba@acbox:~$
If you want to suppress any output other than the timeseries AMDPR, you can add the switch -q
:
acdba@acbox:~$ echo C0.ISS.1 | dumpdata -q CONSOLIDATION_C0
CONSOLIDATION_C0,C0.ISS.1,F,A,0,-1,1,5,2,32,3,3,0,1,2622,4,100,5,0,6,52,8,-1,10,0,11,0,12,0,13,0,15,0,16,0,27,0,28,0,32,0,7,"no_change('C0#TS001',1);"
CONSOLIDATION_C0,C0.ISS.1,D,A,20180319,235959,2622,123.5,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180320,235959,2622,247,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180321,235959,2622,494,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180322,235959,2622,988,1
acdba@acbox:~$
Next, you may want to see attribute names (or tags) instead of numerical IDs. Just add -a
:
acdba@acbox:~$ echo C0.ISS.1 | dumpdata -aq CONSOLIDATION_C0
CONSOLIDATION_C0,C0.ISS.1,F,A,0,-1,1,5,2,32,3,3,DATE,TIME,C0#TS001,4,100,5,0,6,52,8,-1,10,0,11,0,12,0,13,0,15,0,16,0,27,0,28,0,32,0,7,"no_change('C0#TS001',1);"
CONSOLIDATION_C0,C0.ISS.1,D,A,20180319,235959,C0#TS001,123.5,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180320,235959,C0#TS001,247,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180321,235959,C0#TS001,494,1
CONSOLIDATION_C0,C0.ISS.1,D,A,20180322,235959,C0#TS001,988,1
acdba@acbox:~$
Look at the above carefully: You now see DATE, TIME and C0#TS001 instead of 0, 1 and 2622.
Also, you may only be interested in the datafile header (e.g. to see which validation functions have been applied).
Then add the flag -h
:
cdba@acbox:~$ echo C0.ISS.1 | dumpdata -ahq CONSOLIDATION_C0
CONSOLIDATION_C0,C0.ISS.1,F,A,0,-1,1,5,2,32,3,3,DATE,TIME,C0#TS001,4,100,5,0,6,52,8,-1,10,0,11,0,12,0,13,0,15,0,16,0,27,0,28,0,32,0,7,"no_change('C0#TS001',1);"
acdba@acbox:~$
You can redirect the output to a file, e.g. as a backup to be restored later or to load timeseries from one environment to another:
acdba@acbox:~$ echo C0.ISS.1 | dumpdata -aq CONSOLIDATION_C0 > c0.iss.1.amdpr
acdba@acbox:~$
You can then load it with amd_pr:
acdba@acbox:~$ amd_pr -AefE c0.iss.1.amdpr
+++INFO+++ 20190419_16:58:30 @(#)amd_pr[7.3/$Revision: 48207 $]: 5 records updated, 0 failed: 4 rows affected, 1 header affected, 255b logged, 0 delta suspects, 0 messages
acdba@acbox:~$
For other available options, please check the AC Server Manual.