Checking status of engines using C-shell

I am relatively new to scripting. I am trying to develop a script that will

  1. Source an executable file as an argument to the script that sets up the environment
  2. Run a command "stat" that gives the status of 5 Engines running on the system
  3. Check the status of the 5 Engines as either "Active" or "Not Found"
  4. Compare the status of all 5 Engines
    if all "Active" exit 0
    if some "Active" & some "Not Found" exit 1
    if all "Not found" exit 2

I have to write this script in C-Shell. Currently I have written the script for Step 1 & 2. For the rest of it I am thinking of storing the status of the 5 Engines in an array and then compare the value of array elements to decide on the exit status. What do experts say? I am also having a little difficulty using Arrays in C-shell. C-shell is not as straight forward as sh or ksh.