A sample SAS Software script with ghimport.sas

This example calls the ghimport 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 5-1. myimporter.sas

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

	  %ghimport(ibdfile=dump-sas.ibd,                         (3)
	            phenfile=genehunter.ped,
	            markers=10,
	            missing=-99,
                    outdate=mydata.ibdphen);
	  
(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.
(2)
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.

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