;;<<PROCESS TEMPLATE>><<MATRIX>>;;
;{note1,note,12,"Perform basic mathematical operations on 2 tables"}   >>>
;{note2,note,10,"The script will operate on the first table of each file"}  >>>
;{note3,note,8,"Example:  mi.1.table1 + mi.2.table1"}   >>>
;Input Matrix File 1: {mati1,filename,"Enter Input Trip Matrix 1",x,"","Trip Matrix (*.mat)|*.mat"}
;Input Matrix File 2: {mati2,filename,"Enter Input Trip Matrix 2",x,"","Trip Matrix (*.mat)|*.mat"}
;Output Matrix File:   {mato,filename,"Enter Output Matrix File Name",x,"","Matrix File (*.mat)|*.mat"}
;Mathematical Operator: {operator,RadioBtn,"Chose Operation","*","/","-","+"}
;*******************************************************************
;                   BASIC MATHEMATICS                              *  
;*******************************************************************
; BY CITILABS
;
; THIS SCRIPT READS TWO TRIP MATRICES, CREATES A MATRIX WITH THE RESULT
;;<<End Parameters>>;;

; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.

RUN PGM=MATRIX
FILEI MATI[1] = {MATI1.Q}
FILEI MATI[2] = {MATI2.Q}

FILEO MATO[1] = {MATO.Q},
      MO=10


MW[1]=mi.1.1
MW[2]=mi.2.1 

if ('{operator}'<>'/')
   MW[10]=MW[1]{operator}MW[2]

else
   JLOOP
   if (MW[2]<>0) MW[10]=MW[1]{operator}MW[2]
   ENDJLOOP
ENDIF

ENDRUN

