A sample SAS Software script with qms2.sas

This example calls the qms2 macro. The macro is told to read IBD information from the file dump-sas.ibd, which would have been generated using pre-sas.sh. The phenotype information is in the file genehunter.ped. The data used has 10 markers, and codes missing phenotypes as -99. The imported data will be saved into the library mydata and the dataset ibdphen.

Example 6-1. myanalyzer.sas

	  libname mydata '$HOME/sas/qms2';
	  options mautosource sasautos=('$HOME/sas/qms2');        (1)
	  options mprint;                                         (2)

	  %qms2(data=mydata.ibdphen,                              (3)
	        output=mydata.qtl,
	        infce=1,
	        infout=mydata.inf);
	   
	   proc print data=mydata.qtl;                            (4)
	   proc print data=mydata.inf;
	  
(1)
The option mautosource tells the SAS Software to look in the specified directory for any macros which are referenced in the script. In this example, the directory sas/qms2/ under the user's home directory will be searched.
(1)
The option mprint will print out the SAS Software statements which are created from the macro. This option isn't necessary for normal usage, but it makes debugging much easier.
(3)
A SAS Software macro is called using the convention %macroname(macroargument1,macroargument2);. For readability, the macro arguments can be split across lines.
(4)
This line will print out the results of the QTL analyses. The qms2 macro does not print anything out on its own. Under normal SAS Software conventions, the output will be saved in, for this example, the file myanalyzer.lst.

After running this SAS Software script two permanent datasets will be created. That dataset can then be used with the qms2 macro or other SAS Software scripts.