The following example opens an output file and writes selected events to it.
Copy the following files from
/var/phy/project/hep/neutrino/work/schol/superk/examplesinto your working directory:
Take a look inside example4.F.
10{{"$1",LOCAL,,RED,,,"recl=5670 status=old",}} 20{{"example4.zbs",LOCAL,,WRT,,,"recl=5670 status=new",}}The first line in the script here associates "$1" (the filename argument to the script) with lun=10, which is opened first by SKOPENF. The second line associates example4.zbs with the output file lun=20, which is opened next by SKOPENF. You can change the names of input and output ZBS files by changing the filenames in the script.
if (nqisk.gt.50) then call kzwrit(luno) endifThis subroutine takes the lun of the file to write to as an argument.
Compile and run this program in the same way as for the first examples. You should get a file called example4.zbs created. This contains the selected events in ZBS format. You can look at them with superscan, or use this file as input to another SK program.
You can have access to more than one input or output file in the same program, by adding more lines to the script that runs the program, and associating a different lun to each file.