Post by MSF Chula at Tuesday, 8 August 2017 04:38 PM

MSF students,

As some of you need microstructure data for your thesis/project, I am trying to setup the process so that you can EFFICIENTLY and SYSTEMATICALLY access data for your project. Benefits of doing this are 2 folds. First, we abide by the agreements with the Stock Exchange of Thailand. Second, it can run faster on the server than your own machine.


1. First, submit the attached form with the SET, together with a copy of your proposal (that already passed the SP1/proposal).

2. Make appointment with me (via email) to obtain the SAMPLE data and SAS template provided to you to write the program. To help you process it faster, data are in SAS format, and program template should help you start correctly. If your codes work well with the sample data, it will work with the entire data period.

3. Data files are stored in this convention. Deal and Order data are stored in the following format.







Note: from 1999 to 2009, it’s yearly format (one file=one year). From 2010 to present, it is monthly format (one file=one month).

The same for Order file as order2001, order2002, and so on.

Data are available from 02Jan1999 to 31Dec2017*. However, some variables may not exist in early data (for example: no short sales flag in 1999-2001), and some variables may be modified by SET in recent dates. Thus, refer to the old data format and variable for data from 1999 to 30 June 2012, and refer to the new data format for data from 1 July 2012 onward**.

* Updated on July 2019.

** For more information, refer to this link:

4. Use folder name and structure as below.

– Put your SAS code in d:\MSF2015\Your_Name\SAS\ (e.g.”D:\MSF2015\Tanakorn\SAS\”)

– Put your supplemental data in  d:\MSF2015\Your_Name\Data\ (e.g.”D:\MSF2015\Tanakorn\Data\”) For example, list of SET50 stocks, list of specific dates you want to study. They can be text, csv, or excel files.

– Put your output in   d:\MSF2015\Your_Name\Output\ (e.g.”D:\MSF2015\Tanakorn\Output\”)

or store as sas file with this statement in SAS ->   LIBNAME output  “d:\MSF2015\Your_Name\Output\”;

I RECOMMEND that you summarize and process data to certain level. Then you can put the intermediate data in SAS format for further analysis on your own machine.

5. Please email me for the SAS template and sample data. Your code MUST be written in an efficient manner by summarizing or retrieving only key variables and data you needed.


6. To facilitate your access as much as possible, I try to make the standard system for everyone. It should help me runnning your code quicker. Please make sure you change folder name in your code before sending to me. This will help speed up the process to run the program. Check out the template of SAS program for details.

7. I will email the output data back to you as soon as the program is done. Please note that it is very normal to take as long as 2-3 days to run the program especially if you need to process several years of data. Thus, you must try to process it efficiently and minimize the data as much as you can.

8. When you finish writing your codes, please send it to me at I’m not responsible for the accuracy and completeness of your code. It’s your job to determine how to obtain the results you need correctly.


# Deal and Order data are available for all securities listed on SET only, no MAI.

# If I do not respond to your email request within 3-5 days, please do not hesitate to remind me again.

# First come first serve. The code will be run in the order I obtain your email. Do not wait until the last minute.

# It’s your responsibility to plan ahead for your project. YOUR DEADLINE IS NOT AN ACCEPTABLE REASON TO HAVE ANY SPECIAL FAVOR OR EXCUSE.

If you have  further questions, please feel free to email me at

Good luck.



Last updated at Tuesday, 16 July 2019 01:02 PM