INDICES

 

Sample Search: Give the NASDAQ Composite quotes for 1995-2001 on a monthly basis.

Finding the code:

On the main Datastream screen, enter HELP SI? in the box next to Program Number. Press Enter.





The NASDAQ is a national index. Select 2 for countries beginning with the letters M-Z. Press Enter.





Select 32 for the United States. Press Enter.





Select 4 for NASDAQ. Press Enter.





In this example, we are interested in the NASDAQ Composite. Notice the listed datatypes to the right of the mnemonic. We are interested in the Price Index (PI). This is the default for the macro. If we wanted the Price High (PH) or Price Low (PL), we would have to list that with the mnemonic when entering the macro. We could also use a maxmin.mac

As we are only interested in the Price Index, we only need to note the mnemonic. Write down the mnemonic for use when entering the Macro.

Drag the cursor to the box marked Macro at the top of the screen. Click on Macro and then click on Edit Macro. Select download.mac from the list of choices and then click OK.



 

NOTE: FOR IMAGES OF ENTERING THE MACRO, RUNNING THE MACRO, AND OPENING THE CSV FILE, PLEASE SEE THE download.mac TUTORIAL AT http://www.princeton.edu/~econlib/ds/samplemac.htm

 

Entering the Macro:

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 a:\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 SSRC 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

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. In this example, the mnemonic will appear as "NASCOMP",

NOTE: You may enter more than one mnemonic. Line up all mnemonics in a column, surrounding each one by quotation marks and following each by a comma, including the LAST code.

Move the cursor to File at the top of the notepad screen and select Save. Click on Save and then minimize this screen.

 

Running the Macro:

Return to the main Datastream screen. Press CLEAR so that he original screen appears. The program will NOT run if you do not return to the main screen.

Select Macro at the top of the screen. Select Run Macro and then select download.mac. Click on OK.

If the macro ran properly, a screen of white numbers should flash up on the main Datastream screen and then the original Datastream screen should return. If it did not run properly, an error message will appear. Note the problem and fix the macro.

 

Opening the CSV file:

Open Microsoft Excel and open your file. If your file does not appear, make sure the browser is selected to search for All Files.

NOTE: Do not run a macro program saved as the same file while that Excel file is open. The macro will not run properly. Save the new macro as a separate file or close the Excel file.

 

Make sure your data is saved to either your floppy disk or on your Unix account.

DO NOT LEAVE FILES SAVED TO THE SSRC COMPUTERS. THEY WILL BE ERASED.