24 2 Data structuresYou can filter by chapter to make it easier tofind the example you want. You can then clickon Open to open it in a text window, or Openand Run to open it and then run it (see Figure2.11).2.5 PracticalFigure 2.11Open and run Example 2.4.1 from the Guide to the GenStat Command Language, Part1 Syntax and Data Management. Notice that you can define the numbers of rows orcolumns using a vector (like a variate or a text), or using a pointer, instead of giving ascalar integer. If you do this, the values of the vector or pointer are used as labels whenthe matrix is printed.
3 SyntaxIn this chapter you will learn the details of the GenStat syntax, including:• GenStat commands, and the roles of their options and parameters;• how names of directives, procedures, options and parameters can be shortened;• how to repeat a command;• how to use the substitution symbol # to insert the values of a data structure into acommand;• how to use progressions, pre- and post-multipliers to specify lists more efficiently;• suffixed identifiers and pointers;• unnamed data structures;• the model formulae that are used to define statistical models.3.1 Syntax of commandsGenStat commands, or statements as we prefer to call them, all have the form:statement-name [ option-settings ] parameter-settings :The statement-name gives the name of the directive or procedure that is to be used, andthe terminating colon (:) can be omitted if the statement is at the end of a line.Conversely, if you want to continue a statement onto the next line, you can end the linewith a continuation symbol \.Parameters specify parallel lists of arguments for the directive or procedure. ForexamplePRINT STRUCTURE=name,pay,hours,rate; DECIMALS=0,2,0,2would print name and hours with no decimal places, and pay and rate with two. Thelist for the first parameter of the directive or procedure must be the longest; for PRINTthis is the parameter STRUCTURE. Other parameters provide ancillary information andthey will be recycled if they are shorter than the first. So, for example, you could writejustPRINT STRUCTURE=name,pay,hours,rate; DECIMALS=0,2A warning is printed if any of the other parameters is longer than the first.Options specify settings that apply to all the (parallel) sets of parameters. For example,if you were to putPRINT [CHANNEL=2] STRUCTURE=name,pay,hours,rate; \DECIMALS=0,2then name, pay, hours, and rate would all be printed to the output file on channel 2(with their attendant numbers of decimal places). Most options have default values,chosen to be those most often required, and so usually they need not be specified. Forexample, here are all the options of PRINT.CHANNEL = identifierSERIAL = string tokenIPRINT = string tokensRLPRINT = string tokensChannel number of file, or identifier of a text to storeoutput; default current output fileWhether structures are to be printed in serial order, i.e. allvalues of the first structure, then all of the second, and soon (yes, no); default no, i.e. values in parallelWhat identifier and/or text to print for the structure(identifier, extra, associatedidentifier),for a table associatedidentifier prints theidentifier of the variate from which the table was formed(e.g. by TABULATE), IPRINT=* suppresses the identifieraltogether; default idenWhat row labels to print (labels, integers,identifiers), RLPRINT=* suppresses row labels