Example of how to use a Readproc to greatly simplify the writing of “overlay” tables

Attached isa spec READPROCEDURE.SPX that shows how touse a Readproc to greatly simplify the writing of tables when you have a situation that would normally call for using Overlay structures.

There are 3 concepts to understand.

  1. Write and use a procedure to execute all the tables. This procedure can contain as many data manipulation commands as you want. It also can contain DOTABLES command which causes the program to read the data again and also put that information in the current table, just as a WRITECASE would cause the current data would be written to the output file.
  2. The DOTABLES command has various options, including a Chain name and LEAVE_TABLES_OPEN. LEAVE_TABLES_OPEN wants to be used when you are going to be hitting a table mulitple times on a single respondent, and you want to make sure that the statistics= tests are treated as dependent rather than independent.
  3. The chain name on this option is used to figure out which tables should be done multiple times. CHAIN= is actually a table element and all the tables under a certain name will be processed whenever a DO_TABLES command is executed with either no chain name specified (default is all chains) or its chain name explicity stated on the command.

NOTE: If you have a chain name and the LEAVE_TABLE_OPEN option on the same DO_TABLES command, you want the LEAVE_TABLE_OPEN option first.

This data layout assumes that cards 2,3,4 are the same set of questions which are asked over for each bank a respondent might use. This allowsyou to write all the questions that deal with banks as straight-forward tables and use the read_procedure to execute those tables for each bank.

NOTE: You can have as many different chain names as you want and you can turn them on and off as many times as you need.

>DEFINE @STUDY READPROCEDURE>PURGESAME~INPUT @STUDY~SET AUTOTAB DROPLOCALEDIT DROPBASE~SPECFILES @STUDY>PRINTFILE @STUDY~DEFINEPROCEDURE= { READER:DO_TABLES  SINGLE DO_TABLES   LEAVE_OPEN  MULTICOPY [2/1.80] = [3/1.80]  DO_TABLES  LEAVE_OPEN MULTICOPY [2/1.80] = [4/1.80]  DO_TABLES MULTI }              TABSET= GLOBAL:EDIT=: -COLUMN_TNA, -PERCENT_SIGN PGWID=100 }STUB_PREFACE=:TOTAL[SUPPRESS] }HEADER=:= Sample file using a read procedure to simplify overlays }BANNER=: