Basics of Writing Batch Programs with Statistical Packages
Rachel A. Gordon · 2012
We are now ready to “roll up our sleeves and get our hands dirty with the raw data.” We know what variables we want to extract from the raw NSFH data file, what subset of the cases we want to keep, and how we want to create and name our new variables. We are poised to write our batch programs to accomplish these tasks, and in this chapter we will learn how to do so. We will start by illustrating the SAS and Stata interfaces and syntax with a few of the NSFH variables. We will write a small batch program to read these variables from the raw data set, verify that their values are what we expect based on the documentation, and save the results and an analytic data set. We will then learn how to create new variables, keep a subset of cases, add comments, check for errors, and some general finishing touches. Display A.4.2 provides a summary of the syntax we will learn throughout the chapter.