13.07.2015 Views

Download pdf guide - VSN International

Download pdf guide - VSN International

Download pdf guide - VSN International

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.4 Abbreviation rules 31parameter) comes after the current one in the implicit ordering. Thus, after CHANNELGenStat would expect by default to find SERIAL; as our statement also has SERIALstraight after CHANNEL, this can be omitted too.PRINT [2; yes] name,pay,hours,rate; DECIMALS=0,2You can include null settings in a statement by typing nothing (other than spaces orcomments or continuation symbols) between two semi-colons. If you insert a null settingfor FIELDWIDTH, GenStat will then be able to deduce that our third parameter setting isfor DECIMALS and so you can simply putPRINT [2; yes] name,pay,hours,rate; ; 0,2Again this does require you to know the implicit ordering for the directive or procedure,but it can save a great deal of typing as you get to know GenStat better.3.5 Repeating a statementThe repetition symbol & provides a very convenient way of repeating a statement. Itterminates the previous statement, if necessary, and then repeats the name of thestatement together with any options that were set. So, for example, you could type thestatementsasREAD [CHANNEL=2] year : READ [CHANNEL=2] day,tempREAD [CHANNEL=2] year & day,tempYou can also modify the options by including further settings after &. ThusREAD [CHANNEL=2] yearREAD [CHANNEL=2; SERIAL=yes] day,tempREAD [CHANNEL=3; SERIAL=yes] sunshine,windspeedcan be simplified toREAD [CHANNEL=2] year& [SERIAL=yes] day,temp& [CHANNEL=3] sunshine,windspeed3.6 PracticalBelow we show a rather verbose GenStat program, stored as Shop.gen. Run theprogram to see what output it gives.TEXT [NVALUES=11] branchVARIATE [NVALUES=11] sales01,sales02VARIATE [NVALUES=11] frontage,depthREAD [PRINT=data,errors,summary] branch, sales01, sales02,\frontage, depthAshford 4741100 496700 25 33Bradford 3386800 350100 21 32Chelmsford 645800 395200 15 22Dartford 2381200 298900 12 28Fordingbridge 1379600 412000 12 25Guildford 2727300 234700 16 26Hereford 2993300 358500 14 32'Milford Haven' 3409000 460600 18 24Oxford 4752400 439100 15 30Stafford 4117400 473700 16 28Twyford 942500 294900 12 16 :CALCULATE [PRINT=*] sales01 = sales01/100CALCULATE [PRINT=*] sales02 = sales02/100CALCULATE [PRINT=summary] allsales = sales01 + sales02CALCULATE [PRINT=summary] sale_pm2 = \allsales / 2 / (frontage * depth)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!