Skip to main content

Datastream

Downloading

There are several ways to download Datastream data. Which one you pick depends on what you want to be able to do with the data.

Capture to Plain Text:

 

This method of downloading saves data in plain ascii text format, readable by most text editors or word processors. Use this method if you are downloading company reports or simple tabular data.

  • Select CAPTURE TO PLAIN TEXT in the FILE menu.
  • In the new window, enter the name your save file will be called ( Use the form C:\temp\filename.txt to save to the temp directory) and click OK.
  • Perform your search, pressing Enter to scroll through your data.
  • When all the data has been displayed or you wish to discontinue saving, click STOP CAPTURE TO PLAIN TEXT in the FILE menu.

Convert Data Channel/Fundline:

This method of downloading saves data in a form readable by most spreadsheet and database programs. Use this method of downloading if you intend to download large amounts of data or wish to be able to manipulate data using programs such as Microsoft Excel or STATA.

There are 2 primary Datachannel programs which can be used to download data for use in spreadsheets: 900A and 900B. These programs are accessible by choosing the DOWNLOAD option as your Type of Request and then choosing the correct Type of Data. These programs retrieve the same data as programs described previously in this handbook. The difference is that these three programs will return the same data, not in tabular form, but as single lines of data separated only by commas. To download in this manner:

  • Select CONVERT DATA CHANNEL/FUNDLINE in the FILE menu.
  • In the new window, choose to save data as the filetype CSV and enter the name your save file will be called using the form c:\temp\filename.csv to save to the temp directory. Click OK.
  • Perform your search. Enter the parameters for your search into program 900A or 900B. Press Enter to execute your search and continue pressing Enter to scroll through your data.
  • When all the data has been displayed or you wish to discontinue saving, click STOP DATA CHANNEL/FUNDLINE in the FILE menu.

Macros (most common):

Macros are the most efficient way to download data.  Examples follow.

 

Macros

 

 

 

1. download.mac
2. datatype.mac
3. list900a.mac
4. period.mac
5. maxmin.mac

download.mac

Use this macro to download data when you only need to retrieve the values associated with your various codes. The download macro is useful for gathering economics data (Program 150Z), interest rates (Help IR?), stock indices returns (HELP SI?), etc.

 

Entering the Macro:

 

After finding the desired codes, click on CLEAR at the top of the screen to return to the main datastream screen.
  • At the top of the screen, click on Macro and then select Edit Macro. Select download.mac from the list of choices and then click OK.



  •  
  • A notepad screen will appear. Change ONLY what it is within quotation marks on this screen. At the top line change the file name to c:\temp\yourfile.csv
  • It is important that you save the macro as a CSV file so that you can open the data in Microsoft Excel, Stata, and SAS. If you do not have a floppy disk with you, save the file to the hard drive and then FTP the document to your Unix account. Files left on library computers will be erased.




     
  • At the line that begins SEND, enter the dates of your search. After the first quotation mark, there is a comma. After this comma, enter the starting date in the form of MM-DD-YY, followed by a comma (see image). Enter the ending date in the same manner.
  •  

    NOTE: If you want your data to run until the present, do not include an ending date and simply leave the two commas following the starting date.

     

    After the commas, enter the frequency for which you want the data. Note the following frequency codes:

    Daily = D

    Weekly = W

    Monthly = M

    Quarterly = Q

    Yearly = Y

     

    5. After TESTLIST:

    DATA

     

    Enter your mnemonic. Enter the code exactly as it appeared on the Datastream screen. Surround the mnemonic with quotation marks, followed by a comma outside of the quotation marks.




     
    1. Click on File and then click on Save. Return to the main Datastream screen (you may have to press CLEAR). The macro will not run unless you are on the main Datastream screen.

    2. Select Macro at the top of the screen and then select Run Macro Select download.mac from the list of choices and then click OK.


     




     

     



     

     

    datatype.mac

     

    The macro below is similar to the download.mac, except for the two-letter extension in the "program" line. This is the datatype code for the program and enables you to retrieve data beyond that supplied by the program and beyond that supplied by the default. Frequently, this is used in the equities program to obtain something other than the default, such as the Price Index.

    You may also use the download.mac simply by augmenting each code with the datatype abbreviation in parentheses: U:IBM(DY). In this example, the macro will retrieve the dividend yield for IBM, Microsoft, and other stocks. But, when there are many codes, it is easier to use the datatype.mac, rather than entering (DY) after every code.

     



     
     

    NOTE: The datatype macro can also be used to retrieve other information, including market value (MV) and return index (RI).

     

     After entering the macro, click on File and then select Save.

    Return to the main Datastream screen (if it is not on the main screen, press CLEAR. The macro will not run if Datastream is not on the original screen. Select Macro from the top of the screen and the click on Run macro. Select datatype.mac from the choices on the left and then click OK. This should enable the program to start.

     

     

    list900a.mac

     

    This macro combines the basic data-retrieving commands of the download macro, but adds list-making commands. The macro instructs Datastream to create a list; for each code on that list. Datastream then retrieves the data, just as it does in the download.mac

    Use the list900A.mac for codes you have obtained from the Equity Lists (HELP EQLI?).




     
     
    • After finding the desired codes, click on CLEAR at the top of the screen to return to the main datastream screen.
    • At the top of the screen, click on Macro and then select Edit Macro. Select list900a.mac from the list of choices and then click OK.

    • A notepad screen will appear. Change ONLY what it is within "quotation marks" on this screen. Rename the listfile as YOURFILE.LST in the first set of quotation marks.
    • Enter the desired mnemonic within quotation marks on the second line.
    • After OPENDATA, rename the listfile the same name, as you did in the first line.
    • In the line beginning with STARTDC, save the file to the a:/ drive. Save the file to c:\temp\yourfile.csv
     

    NOTE: It is important that you save the macro as a CSV file so that you can open the data in Microsoft Excel, Stata, and SAS. If you do not have a floppy disk with you, save the file to the hard drive and then FTP the document to your Unix account. Files left on library  computers will be erased.

     

     

    • At the line that begins SEND, enter the dates of your search. After the first quotation mark, there is a comma. After this comma, enter the starting date in the form of MM-DD-YY, followed by a comma (see image). Enter the ending date in the same manner.

    NOTE: If you want your data to run until the present, do not include an ending date and simply leave the two commas following the starting date.


     

     


     

    After entering the macro, click on File and then select Save.

    Return to the main Datastream screen (if it is not on the main screen, press CLEAR. The macro will not run if Datastream is not on the original screen. Select Macro from the top of the screen and the click on Run macro. Select list900a.mac from the choices on the left and then click OK. This should enable the program to start.

     

     

     

    period.mac

     

    Use this macro to download data when you have relatively few series, but need data from a variety of periods and/or frequencies.




     
     
    1. After finding the desired codes, click on CLEAR at the top to return to the main Datastream screen.
    2. At the top of the screen, click on Macro and then select Edit Macro. Select period.mac from the list of choices and then click OK.

    3. A notepad screen will appear. Change ONLY what it is within quotation marks on this screen. At the top line change the file name to c:\temp\yourfile.csv

    It is important that you save the macro as a CSV file so that you can open the data in Microsoft Excel, Stata, and SAS. If you do not have a floppy disk with you, save the file to the hard drive and then FTP the document to your Unix account. Files left on library computers will be erased.

     

    4. FOR EACH DIFFERENT DATE AND PERIOD:

    • Enter the mnemonic immediately before the first comma.
    • Enter the start date between the 1st and 2nd commas, and enter the end date (if necessary) between the 2nd and 3rd commas.

    NOTE: If you want your data to run until the present, do not include an ending date and simply leave the two commas following the starting date.

    • Enter the desired frequency of the data. Use D,W,M,Q, or Y. See download.mac at the top of this page for further explanation.





     

    5. After entering the macro, click on File and then select Save.

    Return to the main Datastream screen (if it is not on the main screen, press CLEAR. The macro will not run if Datastream is not on the original screen. Select Macro from the top of the screen and the click on Run macro. Select period.mac from the choices on the left and then click OK. This should enable the program to start.

    maxmin.mac

    Use this macro to download the highest (or lowest) price of each Price High (or Price Low) of a specified period.

    As with the download.mac, after finding the desired codes, click on CLEAR at the top to return to the main Datastream screen.

    At the top of the screen, click on Macro and then select Edit Macro. Select maxmin.mac from the list of choices and then click OK.


     

     


     

    A notepad screen will appear. Change ONLY what it is within quotation marks on this screen. At the top line change the file name to c:\temp\yourfile.csv

    It is important that you save the macro as a CSV file so that you can open the data in Microsoft Excel, Stata, and SAS. If you do not have a floppy disk with you, save the file to the hard drive and then FTP the document to your Unix account. Files left on library computers will be erased.

    FOR EACH INDEX:

     

    1. Within the second set of parentheses, enter the desired mnemonic.

    2. Within the third set of parentheses, enter PH or PL. After the comma, enter MAX or MIN. These give the option of the MAX or MIn of the Price High or the Price Low of the day/week/month/quarter/year as selected.

    3. Enter the START DATE between the first and second commas. Enter the END DATE (if used) between the second and third commas.

    4. Select the desired frequency, entering D/W/M/Q/Y for daily, weekly, monthly, quarterly, or yearly.