//*******************************************************************
//
// NAME      : marcfield.txt
// BEDEUTUNG : Scripts for field checks
// VERSION   : $Name:  $
// CVS-ID    : $Revision: 1.1.1.1 $
// UPDATE    : $Date: 2013/04/29 11:21:04 $ by $Author: frankb $
// BEMERKUNG : MARC-Version
//
//*******************************************************************

// BIBLIOGRAPHIC RECORDS

proc CHECK006

string x
choose substr(:006,1,1)
   case = "a" or = "t"
       x = do(CHECK006BK(&P1,&P2,&P3,&P4))
   case = "m"
       x = do(CHECK006CF(&P1,&P2,&P3,&P4))
   case = "e" or = "f"
       x = do(CHECK006MP(&P1,&P2,&P3,&P4))
   case = "c" or = "d" or = "i" or = "j"
       x = do(CHECK006MU(&P1,&P2,&P3,&P4))
   case = "s"
       x = do(CHECK006SE(&P1,&P2,&P3,&P4))
   case = "g" or = "k" or = "o" or = "r"
       x = do(CHECK006VM(&P1,&P2,&P3,&P4))
   case = "p"
       x = do(CHECK006MX(&P1,&P2,&P3,&P4))
   
end choose
end proc


proc CHECK006BK // BOOKS

choose substr(&P1,3)
   case = "TIT" 

STRING T0 = "at|"
STRING T1 = "-abcdefghijklmop|"
STRING T5 = "-abcdefgj|"
STRING T6 = "-abcdfrs|"
STRING T7 = "-abcdefgijklmnopqrstuvwz|"
STRING T11 = "-acfilmosuz|"
STRING T12 = "01|"
STRING T15 = "-|"
STRING T16 = "01cdefhijmpsu|"
STRING T17 = "-abcd|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "006" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "006" + "1"
   end if
   if instr(T1, substr(&P4,3,1)) = "" then
      message "1150" + "006" + "2"
   end if
   if instr(T1, substr(&P4,4,1)) = "" then
      message "1150" + "006" + "3"
   end if
   if instr(T1, substr(&P4,5,1)) = "" then
      message "1150" + "006" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "006" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "006" + "6"
   end if
   if instr(T7, substr(&P4,8,1)) = "" then
      message "1150" + "006" + "7"
   end if
   if instr(T7, substr(&P4,9,1)) = "" then
      message "1150" + "006" + "8"
   end if
   if instr(T7, substr(&P4,10,1)) = "" then
      message "1150" + "006" + "9"
   end if
   if instr(T7, substr(&P4,11,1)) = "" then
      message "1150" + "006" + "10"
   end if
   if instr(T11, substr(&P4,12,1)) = "" then
      message "1150" + "006" + "11"
   end if
   if instr(T12, substr(&P4,13,1)) = "" then
      message "1150" + "006" + "12"
   end if
   if instr(T12, substr(&P4,14,1)) = "" then
      message "1150" + "006" + "13"
   end if
   if instr(T12, substr(&P4,15,1)) = "" then
      message "1150" + "006" + "14"
   end if
   if instr(T15, substr(&P4,16,1)) = "" then
      message "1150" + "006" + "15"
   end if
   if instr(T16, substr(&P4,17,1)) = "" then
      message "1150" + "006" + "16"
   end if
   if instr(T17, substr(&P4,18,1)) = "" then
      message "1150" + "006" + "17"
   end if

end choose
end proc


proc CHECK006CF // COMPUTER FILES

choose substr(&P1,3)
   case = "TIT" 

STRING T0 = "m|"
STRING T1 = "-|"
STRING T5 = "-abcdefgj|"
STRING T9 = "abcdefghijmuz|"
STRING T11 = "-acfilmosuz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "006" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "006" + "1"
   end if
   if instr(T1, substr(&P4,3,1)) = "" then
      message "1150" + "006" + "2"
   end if
   if instr(T1, substr(&P4,4,1)) = "" then
      message "1150" + "006" + "3"
   end if
   if instr(T1, substr(&P4,5,1)) = "" then
      message "1150" + "006" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "006" + "5"
   end if
   if instr(T1, substr(&P4,7,1)) = "" then
      message "1150" + "006" + "6"
   end if
   if instr(T1, substr(&P4,8,1)) = "" then
      message "1150" + "006" + "7"
   end if
   if instr(T1, substr(&P4,9,1)) = "" then
      message "1150" + "006" + "8"
   end if
   if instr(T9, substr(&P4,10,1)) = "" then
      message "1150" + "006" + "9"
   end if
   if instr(T1, substr(&P4,11,1)) = "" then
      message "1150" + "006" + "10"
   end if
   if instr(T11, substr(&P4,12,1)) = "" then
      message "1150" + "006" + "11"
   end if
   if instr(T1, substr(&P4,13,1)) = "" then
      message "1150" + "006" + "12"
   end if
   if instr(T1, substr(&P4,14,1)) = "" then
      message "1150" + "006" + "13"
   end if
   if instr(T1, substr(&P4,15,1)) = "" then
      message "1150" + "006" + "14"
   end if
   if instr(T1, substr(&P4,16,1)) = "" then
      message "1150" + "006" + "15"
   end if
   if instr(T1, substr(&P4,17,1)) = "" then
      message "1150" + "006" + "16"
   end if
   if instr(T1, substr(&P4,18,1)) = "" then
      message "1150" + "006" + "17"
   end if

end choose
end proc

proc CHECK006MP // MAPS

choose substr(&P1,3)
   case = "TIT" 

STRING T0 = "ef|"
STRING T1 = "-abcdefgijkmz|"
STRING T5 = "-abcdz|"
STRING T6 = "-abcdefghijlmnoprsuz|"
STRING T7 = "-|"
STRING T8 = "abcdefguz|"
STRING T11 = "-abcdfilmorsuz|"
STRING T14 = "01|"
STRING T16 = "-ejklmnopqrz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "006" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "006" + "1"
   end if
   if instr(T1, substr(&P4,3,1)) = "" then
      message "1150" + "006" + "2"
   end if
   if instr(T1, substr(&P4,4,1)) = "" then
      message "1150" + "006" + "3"
   end if
   if instr(T1, substr(&P4,5,1)) = "" then
      message "1150" + "006" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "006" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "006" + "6"
   end if
   if instr(T7, substr(&P4,8,1)) = "" then
      message "1150" + "006" + "7"
   end if
   if instr(T8, substr(&P4,9,1)) = "" then
      message "1150" + "006" + "8"
   end if
   if instr(T7, substr(&P4,10,1)) = "" then
      message "1150" + "006" + "9"
   end if
   if instr(T7, substr(&P4,11,1)) = "" then
      message "1150" + "006" + "10"
   end if
   if instr(T11, substr(&P4,12,1)) = "" then
      message "1150" + "006" + "11"
   end if
   if instr(T7, substr(&P4,13,1)) = "" then
      message "1150" + "006" + "12"
   end if
   if instr(T7, substr(&P4,14,1)) = "" then
      message "1150" + "006" + "13"
   end if
   if instr(T14, substr(&P4,15,1)) = "" then
      message "1150" + "006" + "14"
   end if
   if instr(T7, substr(&P4,16,1)) = "" then
      message "1150" + "006" + "15"
   end if
   if instr(T16, substr(&P4,17,1)) = "" then
      message "1150" + "006" + "16"
   end if
   if instr(T16, substr(&P4,18,1)) = "" then
      message "1150" + "006" + "17"
   end if

end choose
end proc


proc CHECK006MU // MUSIC

choose substr(&P1,3)
   case = "TIT" 

STRING T0 = "cdij|"
STRING T1 = "abcdfghjmnoprstuvwz|"
STRING T2 = "ndgltabchnoprstyzfvmiu|"
STRING T3 = "abcdegmnuz|"
STRING T4 = "-defnu|"
STRING T5 = "-abcdefgj|"
STRING T6 = "-abcdfrs|"
STRING T7 = "-abcdefghikrsz|"
STRING T13 = "-abcdefghijklmnoprstz|"
STRING T16 = "-abcnu"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "006" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "006" + "1"
   end if
   if instr(T1, substr(&P4,3,1)) = "" then
      message "1150" + "006" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "006" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "006" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "006" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "006" + "6"
   end if
   if instr(T7, substr(&P4,8,1)) = "" then
      message "1150" + "006" + "7"
   end if
   if instr(T7, substr(&P4,9,1)) = "" then
      message "1150" + "006" + "8"
   end if
   if instr(T7, substr(&P4,10,1)) = "" then
      message "1150" + "006" + "9"
   end if
   if instr(T7, substr(&P4,11,1)) = "" then
      message "1150" + "006" + "10"
   end if
   if instr(T7, substr(&P4,12,1)) = "" then
      message "1150" + "006" + "11"
   end if
   if instr(T7, substr(&P4,13,1)) = "" then
      message "1150" + "006" + "12"
   end if
   if instr(T13, substr(&P4,14,1)) = "" then
      message "1150" + "006" + "13"
   end if
   if instr(T13, substr(&P4,15,1)) = "" then
      message "1150" + "006" + "14"
   end if
   if instr(T4, substr(&P4,16,1)) = "" then
      message "1150" + "006" + "15"
   end if
   if instr(T16, substr(&P4,17,1)) = "" then
      message "1150" + "006" + "16"
   end if
   if instr(T4, substr(&P4,18,1)) = "" then
      message "1150" + "006" + "17"
   end if

end choose
end proc


proc CHECK006SE // SERIALS

choose substr(&P1,3)
   case = "TIT" 

STRING T0 = "s|"
STRING T1 = "-abcdefghijkmqstuwz|"
STRING T2 = "nrux|"
STRING T3 = "-0124z|"
STRING T4 = "-dlmnpw|"
STRING T5 = "-abcdefs|"
STRING T6 = "-abcdfrs|"
STRING T7 = "-abcdefghiklmnopqrstuvwz|"
STRING T11 = "-acfilmosuz|"
STRING T12 = "01|"
STRING T13 = "-|"
STRING T16 = "-abcdefghijkluz|2"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "006" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "006" + "1"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "006" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "006" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "006" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "006" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "006" + "6"
   end if
   if instr(T7, substr(&P4,8,1)) = "" then
      message "1150" + "006" + "7"
   end if
   if instr(T7, substr(&P4,9,1)) = "" then
      message "1150" + "006" + "8"
   end if
   if instr(T7, substr(&P4,10,1)) = "" then
      message "1150" + "006" + "9"
   end if
   if instr(T7, substr(&P4,11,1)) = "" then
      message "1150" + "006" + "10"
   end if
   if instr(T11, substr(&P4,12,1)) = "" then
      message "1150" + "006" + "11"
   end if
   if instr(T12, substr(&P4,13,1)) = "" then
      message "1150" + "006" + "12"
   end if
   if instr(T13, substr(&P4,14,1)) = "" then
      message "1150" + "006" + "13"
   end if
   if instr(T13, substr(&P4,15,1)) = "" then
      message "1150" + "006" + "14"
   end if
   if instr(T13, substr(&P4,16,1)) = "" then
      message "1150" + "006" + "15"
   end if
   if instr(T16, substr(&P4,17,1)) = "" then
      message "1150" + "006" + "16"
   end if
   if instr(T12, substr(&P4,18,1)) = "" then
      message "1150" + "006" + "17"
   end if

end choose
end proc


proc CHECK006VM // VISUAL MATERIALS

choose substr(&P1,3)
   case = "TIT" 

STRING T0 = "gkor|"
STRING T4 = "-|"
STRING T5 = "-abcdefgj|"
STRING T11 = "-abcdfilmorsuz|"
STRING T16 = "abcdfgiklmnopqrstvwz|"
STRING T17 = "aclnuz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "006" + "0"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "006" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "006" + "5"
   end if
   if instr(T4, substr(&P4,7,1)) = "" then
      message "1150" + "006" + "6"
   end if
   if instr(T4, substr(&P4,8,1)) = "" then
      message "1150" + "006" + "7"
   end if
   if instr(T4, substr(&P4,9,1)) = "" then
      message "1150" + "006" + "8"
   end if
   if instr(T4, substr(&P4,10,1)) = "" then
      message "1150" + "006" + "9"
   end if
   if instr(T4, substr(&P4,11,1)) = "" then
      message "1150" + "006" + "10"
   end if
   if instr(T11, substr(&P4,12,1)) = "" then
      message "1150" + "006" + "11"
   end if
   if instr(T4, substr(&P4,13,1)) = "" then
      message "1150" + "006" + "12"
   end if
   if instr(T4, substr(&P4,14,1)) = "" then
      message "1150" + "006" + "13"
   end if
   if instr(T4, substr(&P4,15,1)) = "" then
      message "1150" + "006" + "14"
   end if
   if instr(T4, substr(&P4,16,1)) = "" then
      message "1150" + "006" + "15"
   end if
   if instr(T16, substr(&P4,17,1)) = "" then
      message "1150" + "006" + "16"
   end if
   if instr(T17, substr(&P4,18,1)) = "" then
      message "1150" + "006" + "17"
   end if

end choose
end proc


proc CHECK006MX // MIXED MATERIALS

choose substr(&P1,3)
   case = "TIT" 

STRING T0 = "p|"
STRING T1 = "-|"
STRING T6 = "-abcdfrs|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "006" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "006" + "1"
   end if
   if instr(T1, substr(&P4,3,1)) = "" then
      message "1150" + "006" + "2"
   end if
   if instr(T1, substr(&P4,4,1)) = "" then
      message "1150" + "006" + "3"
   end if
   if instr(T1, substr(&P4,5,1)) = "" then
      message "1150" + "006" + "4"
   end if
   if instr(T1, substr(&P4,6,1)) = "" then
      message "1150" + "006" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "006" + "6"
   end if
   if instr(T1, substr(&P4,8,1)) = "" then
      message "1150" + "006" + "7"
   end if
   if instr(T1, substr(&P4,9,1)) = "" then
      message "1150" + "006" + "8"
   end if
   if instr(T1, substr(&P4,10,1)) = "" then
      message "1150" + "006" + "9"
   end if
   if instr(T1, substr(&P4,11,1)) = "" then
      message "1150" + "006" + "10"
   end if
   if instr(T1, substr(&P4,12,1)) = "" then
      message "1150" + "006" + "11"
   end if
   if instr(T1, substr(&P4,13,1)) = "" then
      message "1150" + "006" + "12"
   end if
   if instr(T1, substr(&P4,14,1)) = "" then
      message "1150" + "006" + "13"
   end if
   if instr(T1, substr(&P4,15,1)) = "" then
      message "1150" + "006" + "14"
   end if
   if instr(T1, substr(&P4,16,1)) = "" then
      message "1150" + "006" + "15"
   end if
   if instr(T1, substr(&P4,17,1)) = "" then
      message "1150" + "006" + "16"
   end if
   if instr(T1, substr(&P4,18,1)) = "" then
      message "1150" + "006" + "17"
   end if

end choose
end proc


proc CHECK007 
string x
choose substr(:007,1,1)
   case = "a" 
       x = do(CHECK007MP(&P1,&P2,&P3,&P4))
   case = "c"
       x = do(CHECK007CF(&P1,&P2,&P3,&P4))
   case = "d"
       x = do(CHECK007GL(&P1,&P2,&P3,&P4))
   case = "f"
       x = do(CHECK007TM(&P1,&P2,&P3,&P4))
   case = "g
       x = do(CHECK007PG(&P1,&P2,&P3,&P4))
   case = "h"
       x = do(CHECK007MF(&P1,&P2,&P3,&P4))
   case = "k"
       x = do(CHECK007NG(&P1,&P2,&P3,&P4))
   case = "m"
       x = do(CHECK007MP(&P1,&P2,&P3,&P4))
   case = "o"
       x = do(CHECK007KT(&P1,&P2,&P3,&P4))
   case = "q"
       x = do(CHECK007NM(&P1,&P2,&P3,&P4))
   case = "r"
       x = do(CHECK007RSI(&P1,&P2,&P3,&P4))
   case = "s"
       x = do(CHECK007SR(&P1,&P2,&P3,&P4))
   case = "t"
       x = do(CHECK007TX(&P1,&P2,&P3,&P4))
   case = "v"
       x = do(CHECK007VR(&P1,&P2,&P3,&P4))
   case = "z"
       x = do(CHECK007UN(&P1,&P2,&P3,&P4))

end choose
end proc


proc CHECK007MP // MAPS

choose substr(&P1,3)
   case = "TIT" or = "HOL" 

STRING T0 = "a"
STRING T1 = "dgjkqrsyuz|"
STRING T2 = "-|"
STRING T3 = "ac|"
STRING T4 = "abcdefgjpqrstuyz|"
STRING T5 = "fnuz|"
STRING T6 = "abcduz|"
STRING T7 = "abmn|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "007" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "007" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "007" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "007" + "6"
   end if
   if instr(T7, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "7"
   end if


end choose
end proc


proc CHECK007CF // COMPUTER FILE

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "c"
STRING T1 = "abcfhjmoruz|"
STRING T2 = "-|"
STRING T3 = "acgmnuz|"
STRING T4 = "aegijnouvz|"
STRING T5 = "-au|"
STRING T9 = "amu|"
STRING T10 = "anpu|"
STRING T11 = "abcdmnu|"
STRING T12 = "abdmu|"
STRING T13 = "anpru|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "007" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "007" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "007" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "5"
   end if
   if instr(T9, substr(&P4,10,1)) = "" then
      message "1150" + "007" + "9"
   end if
   if instr(T10, substr(&P4,11,1)) = "" then
      message "1150" + "007" + "10"
   end if
   if instr(T11, substr(&P4,12,1)) = "" then
      message "1150" + "007" + "11"
   end if
   if instr(T12, substr(&P4,13,1)) = "" then
      message "1150" + "007" + "12"
   end if
   if instr(T13, substr(&P4,14,1)) = "" then
      message "1150" + "007" + "13"
   end if

end choose
end proc


proc CHECK007GL // GLOBE

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "d"
STRING T1 = "abceuz|"
STRING T2 = "-|"
STRING T3 = "ac|"
STRING T4 = "abcdefgpuz|"
STRING T5 = "fnuz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "007" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "007" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "007" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "5"
   end if

end choose
end proc

proc CHECK007TM // TACTILE MATERIAL

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING TO = "f"
STRING T1 = "abcduz|"
STRING T2 = " |"
STRING T3 = "abcdemnuz|"
STRING T5 = "abmnuz|"
STRING T6 = "abcdefghijklnu|"
STRING T9 = "abnuz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "007" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "007" + "3"
   end if
   if instr(T3, substr(&P4,5,1)) = "" then
      message "1150" + "007" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "007" + "6"
   end if
   if instr(T6, substr(&P4,8,1)) = "" then
      message "1150" + "007" + "7"
   end if
   if instr(T6, substr(&P4,9,1)) = "" then
      message "1150" + "007" + "8"
   end if
   if instr(T9, substr(&P4,10,1)) = "" then
      message "1150" + "007" + "9"
   end if

end choose
end proc
   

proc CHECK007PG // PROJECTED GRAPHIC

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "g"
STRING T1 = "cdfostuz|"
STRING T2 = "-|"
STRING T3 = "abchmnuz|"
STRING T4 = "dejkmouz|"
STRING T5 = "-abu|"
STRING T6 = "-abcdefghiuz|"
STRING T7 = "abcdefgjkstuvwxyz|"
STRING T8 = "-cdehjkmuz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "007" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "007" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "007" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "007" + "6"
   end if
   if instr(T7, substr(&P4,8,1)) = "" then
      message "1150" + "007" + "7"
   end if
   if instr(T8, substr(&P4,9,1)) = "" then
      message "1150" + "007" + "8"
   end if

end choose
end proc


proc CHECK007MF // MICROFORM

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "h"
STRING T1 = "abcdefguz|"
STRING T2 = "-|"
STRING T3 = "abmu|"
STRING T4 = "adfghlmopuz|"
STRING T5 = "abcdeuv|"
STRING T9 = "bcmuz|"
STRING T10 = "abcmnuz|"
STRING T11 = "abcmu|"
STRING T12 = "acdprtimnuz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "007" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "007" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "007" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "5"
   end if
   if instr(T9, substr(&P4,10,1)) = "" then
      message "1150" + "007" + "9"
   end if
   if instr(T10, substr(&P4,11,1)) = "" then
      message "1150" + "007" + "10"
   end if
   if instr(T11, substr(&P4,12,1)) = "" then
      message "1150" + "007" + "11"
   end if
   if instr(T12, substr(&P4,13,1)) = "" then
      message "1150" + "007" + "12"
   end if

end choose
end proc


proc CHECK007NG // NONPROJECTED GRAPHIC

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "k"
STRING T1 = "cdefghijlnouz|"
STRING T2 = "-|"
STRING T3 = "abchmuz|"
STRING T4 = "abcdefghopqrstuz|"
STRING T5 = "-abcdefghmopqrstuz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "007" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "007" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "007" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "5"
   end if
  
end choose
end proc


proc CHECK007MP // MOTION PICTURE

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "m"
STRING T1 = "cfruz|"
STRING T2 = "-|"
STRING T3 = "bchmnuz|"
STRING T4 = "abcdefuz|"
STRING T5 = "-abu|"
STRING T6 = "-abcdefghiuz|"
STRING T7 = "abcdefguz|"
STRING T8 = "kmnqsuz|"
STRING T9 = "abcdefgnz|"
STRING T10 = "abnuz|"
STRING T11 = "deoruz|"
STRING T12 = "acdprtimnuz|"
STRING T13 = "abcdefghijklmnpqrstuvz|"
STRING T14 = "abcdnuz|"
STRING T15 = "abcdefghklm|"
STRING T16 = "cinu|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "007" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "007" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "007" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "007" + "6"
   end if
   if instr(T7, substr(&P4,8,1)) = "" then
      message "1150" + "007" + "7"
   end if
   if instr(T8, substr(&P4,9,1)) = "" then
      message "1150" + "007" + "8"
   end if
   if instr(T9, substr(&P4,10,1)) = "" then
      message "1150" + "007" + "9"
   end if
   if instr(T10, substr(&P4,11,1)) = "" then
      message "1150" + "007" + "10"
   end if 
   if instr(T11, substr(&P4,12,1)) = "" then
      message "1150" + "007" + "11"
   end if
   if instr(T12, substr(&P4,13,1)) = "" then
      message "1150" + "007" + "12"
   end if
   if instr(T13, substr(&P4,14,1)) = "" then
      message "1150" + "007" + "13"
   end if
   if instr(T14, substr(&P4,15,1)) = "" then
      message "1150" + "007" + "14"
   end if
   if instr(T15, substr(&P4,16,1)) = "" then
      message "1150" + "007" + "15"
   end if
   if instr(T16, substr(&P4,17,1)) = "" then
      message "1150" + "007" + "16"
   end if
   if instr(T17, substr(&P4,18,1)) = "" then
      message "1150" + "007" + "17"
   end if  

end choose
end proc

proc CHECK007KT // KIT

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "o"
STRING T1 = "u|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if

end choose
end proc


proc CHECK007NM // NOTATED MUSIC

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "q"
STRING T1 = "u|"

if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if

end choose
end proc


proc CHECK007RSI // REMOTE-SENSING IMAGE

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "r"
STRING T1 = "u"
STRING T2 = "-|"
STRING T3 = "abcnuz|"
STRING T4 = "abcnu|"
STRING T5 = "0123456789nu|"
STRING T6 = "abcdefghinuz|"
STRING T7 = "abcmnuz|"
STRING T8 = "abuz|"
STRING T9 = "adgjmnprstuz|"
STRING T10 = "abcdefgmnuvz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "007" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "007" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "007" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "007" + "6"
   end if
   if instr(T7, substr(&P4,8,1)) = "" then
      message "1150" + "007" + "7"
   end if
   if instr(T8, substr(&P4,9,1)) = "" then
      message "1150" + "007" + "8"
   end if
   if instr(T9, substr(&P4,10,1)) = "" then
      message "1150" + "007" + "9"
   end if
   if instr(T10, substr(&P4,11,1)) = "" then
      message "1150" + "007" + "10"
   end if 

end choose
end proc


proc CHECK007SR // SOUND RECORDING

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "s"
STRING T1 = "degiqstuwz|"
STRING T2 = "-|"
STRING T3 = "abcdefhiklmopruz|"
STRING T4 = "mqsuz|"
STRING T5 = "mnsuz|"
STRING T6 = "abcdefgjonsuz|"
STRING T7 = "lmnopuz|"
STRING T8 = "abcdefnuz|"
STRING T9 = "abdimnrstuz|"
STRING T10 = "abcgilmnprsuwz|"
STRING T11 = "hlnu|"
STRING T12 = "abcdefghnuz|"
STRING T13 = "abdeuz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "007" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "007" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "007" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "007" + "6"
   end if
   if instr(T7, substr(&P4,8,1)) = "" then
      message "1150" + "007" + "7"
   end if
   if instr(T8, substr(&P4,9,1)) = "" then
      message "1150" + "007" + "8"
   end if
   if instr(T9, substr(&P4,10,1)) = "" then
      message "1150" + "007" + "9"
   end if
   if instr(T10, substr(&P4,11,1)) = "" then
      message "1150" + "007" + "10"
   end if 
   if instr(T11, substr(&P4,12,1)) = "" then
      message "1150" + "007" + "11"
   end if 
   if instr(T12, substr(&P4,13,1)) = "" then
      message "1150" + "007" + "12"
   end if 
   if instr(T13, substr(&P4,14,1)) = "" then
      message "1150" + "007" + "13"
   end if 

end choose
end proc


proc CHECK007TX // TEXT

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "t"
STRING T1 = "abcduz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if

end choose
end proc


proc CHECK007VR // VIDEO RECORDING

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "v"
STRING T1 = "cdfruz|"
STRING T2 = "-|"
STRING T3 = "abcmnuz|"
STRING T4 = "abcdefghijkmnopquvz|"
STRING T5 = "-abu|"
STRING T6 = "-abcdefghiuz|"
STRING T7 = "amopqruz|"
STRING T8 = "kmnqsuz"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if
   if instr(T2, substr(&P4,3,1)) = "" then
      message "1150" + "007" + "2"
   end if
   if instr(T3, substr(&P4,4,1)) = "" then
      message "1150" + "007" + "3"
   end if
   if instr(T4, substr(&P4,5,1)) = "" then
      message "1150" + "007" + "4"
   end if
   if instr(T5, substr(&P4,6,1)) = "" then
      message "1150" + "007" + "5"
   end if
   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "007" + "6"
   end if
   if instr(T7, substr(&P4,8,1)) = "" then
      message "1150" + "007" + "7"
   end if
   if instr(T8, substr(&P4,9,1)) = "" then
      message "1150" + "007" + "8"
   end if
 
end choose
end proc


proc CHECK007UN // UNSPECIFIED

choose substr(&P1,3)
   case = "TIT" or = "HOL"

STRING T0 = "z"
STRING T1 = "muz|"

   if instr(T0, substr(&P4,1,1)) = "" then
      message "1150" + "007" + "0"
   end if
   if instr(T1, substr(&P4,2,1)) = "" then
      message "1150" + "007" + "1"
   end if

end choose
end proc


proc CHECK008

string x
choose :FMT
   case = "BK" 
       x = do(CHECK008BK(&P1,&P2,&P3,&P4))
   case = "CF"
       x = do(CHECK008CF(&P1,&P2,&P3,&P4))
   case = "MP"
       x = do(CHECK008MP(&P1,&P2,&P3,&P4))
   case = "MU"
       x = do(CHECK008MU(&P1,&P2,&P3,&P4))
   case = "SE"
       x = do(CHECK008SE(&P1,&P2,&P3,&P4))
   case = "VM"
       x = do(CHECK008VM(&P1,&P2,&P3,&P4))
   case = "MX"
       x = do(CHECK008MX(&P1,&P2,&P3,&P4))
   case = "AU"
       x = do(CHECK008AU(&P1,&P2,&P3,&P4))
   case = "HO"
       x = do(CHECK008HO(&P1,&P2,&P3,&P4))

end choose
end proc


proc CHECK008BK // BOOKS

choose substr(&P1,3)
   case = "TIT" 

STRING T6 = "-bcdeikmnpqrstu|"
STRING T18 = "-abcdefghijklmop|"
STRING T22 = "-abcdefgj|"
STRING T23 = "-abcdfrs|"
STRING T24 = "-abcdefgijklmnopqrstuvwz|"
STRING T28 = "-acfilmosuz|"
STRING T29 = "01|"
STRING T32 = "-|"
STRING T33 = "01cdefhijmpsu|"
STRING T34 = "-abcd|"
STRING T38 = "-dorsx|"
STRING T39 = "-cdu|"

   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "008" + "6"
   end if
   if instr(T18, substr(&P4,19,1)) = "" then
      message "1150" + "008" + "18"
   end if
   if instr(T18, substr(&P4,20,1)) = "" then
      message "1150" + "008" + "19"
   end if
   if instr(T18, substr(&P4,21,1)) = "" then
      message "1150" + "008" + "20"
   end if
   if instr(T18, substr(&P4,22,1)) = "" then
      message "1150" + "008" + "21"
   end if
   if instr(T22, substr(&P4,23,1)) = "" then
      message "1150" + "008" + "22"
   end if
   if instr(T23, substr(&P4,24,1)) = "" then
      message "1150" + "008" + "23"
   end if
   if instr(T24, substr(&P4,25,1)) = "" then
      message "1150" + "008" + "24"
   end if
   if instr(T24, substr(&P4,26,1)) = "" then
      message "1150" + "008" + "25"
   end if
   if instr(T24, substr(&P4,27,1)) = "" then
      message "1150" + "008" + "26"
   end if
   if instr(T24, substr(&P4,28,1)) = "" then
      message "1150" + "008" + "27"
   end if
   if instr(T28, substr(&P4,29,1)) = "" then
      message "1150" + "008" + "28"
   end if
   if instr(T29, substr(&P4,30,1)) = "" then
      message "1150" + "008" + "29"
   end if
   if instr(T29, substr(&P4,31,1)) = "" then
      message "1150" + "008" + "30"
   end if
   if instr(T29, substr(&P4,32,1)) = "" then
      message "1150" + "008" + "31"
   end if
   if instr(T32, substr(&P4,33,1)) = "" then
      message "1150" + "008" + "32"
   end if
   if instr(T33, substr(&P4,34,1)) = "" then
      message "1150" + "008" + "33"
   end if
   if instr(T34, substr(&P4,35,1)) = "" then
      message "1150" + "008" + "34"
   end if
   if instr(T38, substr(&P4,39,1)) = "" then
      message "1150" + "008" + "38"
   end if
   if instr(T39, substr(&P4,40,1)) = "" then
      message "1150" + "008" + "39"
   end if

end choose
end proc


proc CHECK008CF // COMPUTER FILES

choose substr(&P1,3)
   case = "TIT" 

STRING T6 = "-bcdeikmnpqrstu|"
STRING T18 = "-|"
STRING T22 = "-abcdefgj|"
STRING T26 = "abcdefghijmuz|"
STRING T28 = "-acfilmosuz|"
STRING T38 = "-dorsx|"
STRING T39 = "-cdu|"

   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "008" + "6"
   end if
   if instr(T18, substr(&P4,19,1)) = "" then
      message "1150" + "008" + "18"
   end if
   if instr(T18, substr(&P4,20,1)) = "" then
      message "1150" + "008" + "19"
   end if
   if instr(T18, substr(&P4,21,1)) = "" then
      message "1150" + "008" + "20"
   end if
   if instr(T18, substr(&P4,22,1)) = "" then
      message "1150" + "008" + "21"
   end if
   if instr(T22, substr(&P4,23,1)) = "" then
      message "1150" + "008" + "22"
   end if
   if instr(T18, substr(&P4,24,1)) = "" then
      message "1150" + "008" + "23"
   end if
   if instr(T18, substr(&P4,25,1)) = "" then
      message "1150" + "008" + "24"
   end if
   if instr(T18, substr(&P4,26,1)) = "" then
      message "1150" + "008" + "25"
   end if
   if instr(T26, substr(&P4,27,1)) = "" then
      message "1150" + "008" + "26"
   end if
   if instr(T18, substr(&P4,28,1)) = "" then
      message "1150" + "008" + "27"
   end if
   if instr(T28, substr(&P4,29,1)) = "" then
      message "1150" + "008" + "28"
   end if
   if instr(T18, substr(&P4,30,1)) = "" then
      message "1150" + "008" + "29"
   end if
   if instr(T18, substr(&P4,31,1)) = "" then
      message "1150" + "008" + "30"
   end if
   if instr(T18, substr(&P4,32,1)) = "" then
      message "1150" + "008" + "31"
   end if
   if instr(T18, substr(&P4,33,1)) = "" then
      message "1150" + "008" + "32"
   end if
   if instr(T18, substr(&P4,34,1)) = "" then
      message "1150" + "008" + "33"
   end if
   if instr(T18, substr(&P4,35,1)) = "" then
      message "1150" + "008" + "34"
   end if
   if instr(T38, substr(&P4,39,1)) = "" then
      message "1150" + "008" + "38"
   end if
   if instr(T39, substr(&P4,40,1)) = "" then
      message "1150" + "008" + "39"
   end if

end choose
end proc


proc CHECK008MP // MAPS

choose substr(&P1,3)
   case = "TIT" 

STRING T6 = "-bcdeikmnpqrstu|"
STRING T18 = "-abcdefgijkmz|"
STRING T22 = "-abcdz|"
STRING T23 = "-abcdefghijlmnoprsuz|"
STRING T24 = "-|"
STRING T25 = "abcdefguz|"
STRING T28 = "-acfilmosuz|"
STRING T29 = "-abcdfrs"
STRING T31 = "01|"
STRING T33 = "-ejklmnopqrz|"
STRING T38 = "-dorsx|"
STRING T39 = "-cdu|"

   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "008" + "6"
   end if
   if instr(T18, substr(&P4,19,1)) = "" then
      message "1150" + "008" + "18"
   end if
   if instr(T18, substr(&P4,20,1)) = "" then
      message "1150" + "008" + "19"
   end if
   if instr(T18, substr(&P4,21,1)) = "" then
      message "1150" + "008" + "20"
   end if
   if instr(T18, substr(&P4,22,1)) = "" then
      message "1150" + "008" + "21"
   end if
   if instr(T22, substr(&P4,23,1)) = "" then
      message "1150" + "008" + "22"
   end if
   if instr(T23, substr(&P4,24,1)) = "" then
      message "1150" + "008" + "23"
   end if
   if instr(T24, substr(&P4,25,1)) = "" then
      message "1150" + "008" + "24"
   end if
   if instr(T25, substr(&P4,26,1)) = "" then
      message "1150" + "008" + "25"
   end if
   if instr(T24, substr(&P4,27,1)) = "" then
      message "1150" + "008" + "26"
   end if
   if instr(T24, substr(&P4,28,1)) = "" then
      message "1150" + "008" + "27"
   end if
   if instr(T28, substr(&P4,29,1)) = "" then
      message "1150" + "008" + "28"
   end if
   if instr(T29, substr(&P4,30,1)) = "" then
      message "1150" + "008" + "29"
   end if
   if instr(T24, substr(&P4,31,1)) = "" then
      message "1150" + "008" + "30"
   end if
   if instr(T31, substr(&P4,32,1)) = "" then
      message "1150" + "008" + "31"
   end if
   if instr(T24, substr(&P4,33,1)) = "" then
      message "1150" + "008" + "32"
   end if
   if instr(T33, substr(&P4,34,1)) = "" then
      message "1150" + "008" + "33"
   end if
   if instr(T33, substr(&P4,35,1)) = "" then
      message "1150" + "008" + "34"
   end if
   if instr(T38, substr(&P4,39,1)) = "" then
      message "1150" + "008" + "38"
   end if
   if instr(T39, substr(&P4,40,1)) = "" then
      message "1150" + "008" + "39"
   end if

end choose
end proc

proc CHECK008MU // MUSIC

choose substr(&P1,3)
   case = "TIT" 

STRING T6 = "-bcdeikmnpqrstu|"
STRING T18 = "abcdfghjmnoprstuvwz|"
STRING T19 = "ndgltabchnoprstyzfvmiu|"
STRING T20 = "abcdegmnuz|"
STRING T21 = "-defnu|"
STRING T22 = "-abcdefgj|"
STRING T23 = "-abcdfrs|"
STRING T24 = "-abcdefghikrsz|"
STRING T30 = "-abcdefghijklmnoprstz|"
STRING T33 = "-abcnu|"
STRING T38 = "-dorsx|"
STRING T39 = "-cdu|"

   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "008" + "6"
   end if
   if instr(T18, substr(&P4,19,1)) = "" then
      message "1150" + "008" + "18"
   end if
   if instr(T19, substr(&P4,20,1)) = "" then
      message "1150" + "008" + "19"
   end if
   if instr(T20, substr(&P4,21,1)) = "" then
      message "1150" + "008" + "20"
   end if
   if instr(T21, substr(&P4,22,1)) = "" then
      message "1150" + "008" + "21"
   end if
   if instr(T22, substr(&P4,23,1)) = "" then
      message "1150" + "008" + "22"
   end if
   if instr(T23, substr(&P4,24,1)) = "" then
      message "1150" + "008" + "23"
   end if
   if instr(T24, substr(&P4,25,1)) = "" then
      message "1150" + "008" + "24"
   end if
   if instr(T24, substr(&P4,26,1)) = "" then
      message "1150" + "008" + "25"
   end if
   if instr(T24, substr(&P4,27,1)) = "" then
      message "1150" + "008" + "26"
   end if
   if instr(T24, substr(&P4,28,1)) = "" then
      message "1150" + "008" + "27"
   end if
   if instr(T24, substr(&P4,29,1)) = "" then
      message "1150" + "008" + "28"
   end if
   if instr(T24, substr(&P4,30,1)) = "" then
      message "1150" + "008" + "29"
   end if
   if instr(T30, substr(&P4,31,1)) = "" then
      message "1150" + "008" + "30"
   end if
   if instr(T30, substr(&P4,32,1)) = "" then
      message "1150" + "008" + "31"
   end if
   if instr(T21, substr(&P4,33,1)) = "" then
      message "1150" + "008" + "32"
   end if
   if instr(T33, substr(&P4,34,1)) = "" then
      message "1150" + "008" + "33"
   end if
   if instr(T21, substr(&P4,35,1)) = "" then
     message "1150" + "008" + "34"
   end if
   if instr(T38, substr(&P4,39,1)) = "" then
      message "1150" + "008" + "38"
   end if
   if instr(T39, substr(&P4,40,1)) = "" then
      message "1150" + "008" + "39"
   end if

end choose
end proc


proc CHECK008SE // SERIALS

choose substr(&P1,3)
   case = "TIT" 

STRING T6 = "-bcdeikmnpqrstu|"
STRING T18 = "-abcdefghijkmqstuwz|"
STRING T19 = "nrux|"
STRING T20 = "-0124z|"
STRING T21 = "-dlmnpw|"
STRING T22 = "-abcdefs|"
STRING T23 = "-abcdfrs|"
STRING T24 = "-abcdefghiklmnopqrstuvwz|"
STRING T28 = "-acfilmosuz|"
STRING T29 = "01|"
STRING T30 = "-|"
STRING T33 = "-abcdefghijkluz2|"
STRING T34 = "012|"
STRING T38 = "-dorsx|"
STRING T39 = "-cdu|"

   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "008" + "6"
   end if
   if instr(T18, substr(&P4,19,1)) = "" then
      message "1150" + "008" + "18"
   end if
   if instr(T19, substr(&P4,20,1)) = "" then
      message "1150" + "008" + "19"
   end if
   if instr(T20, substr(&P4,21,1)) = "" then
      message "1150" + "008" + "20"
   end if
   if instr(T21, substr(&P4,22,1)) = "" then
      message "1150" + "008" + "21"
   end if
   if instr(T22, substr(&P4,23,1)) = "" then
      message "1150" + "008" + "22"
   end if
   if instr(T23, substr(&P4,24,1)) = "" then
      message "1150" + "008" + "23"
   end if
   if instr(T24, substr(&P4,25,1)) = "" then
      message "1150" + "008" + "24"
   end if
   if instr(T24, substr(&P4,26,1)) = "" then
      message "1150" + "008" + "25"
   end if
   if instr(T24, substr(&P4,27,1)) = "" then
      message "1150" + "008" + "26"
   end if
   if instr(T24, substr(&P4,28,1)) = "" then
      message "1150" + "008" + "27"
   end if
   if instr(T28, substr(&P4,29,1)) = "" then
      message "1150" + "008" + "28"
   end if
   if instr(T29, substr(&P4,30,1)) = "" then
      message "1150" + "008" + "29"
   end if
   if instr(T30, substr(&P4,31,1)) = "" then
      message "1150" + "008" + "30"
   end if
   if instr(T30, substr(&P4,32,1)) = "" then
      message "1150" + "008" + "31"
   end if
   if instr(T30, substr(&P4,33,1)) = "" then
      message "1150" + "008" + "32"
   end if
   if instr(T33, substr(&P4,34,1)) = "" then
      message "1150" + "008" + "33"
   end if
   if instr(T34, substr(&P4,35,1)) = "" then
      message "1150" + "008" + "34"
   end if
   if instr(T38, substr(&P4,39,1)) = "" then
      message "1150" + "008" + "38"
   end if
   if instr(T39, substr(&P4,40,1)) = "" then
      message "1150" + "008" + "39"
   end if

end choose
end proc


proc CHECK008VM // VISUAL MATERIALS

choose substr(&P1,3)
   case = "TIT" 

STRING T6 = "-bcdeikmnpqrstu|"
STRING T21 = "-|"
STRING T22 = "-abcdefgj|"
STRING T28 = "-acfilmosuz|"
STRING T29 = "-abcdfrs"
STRING T33 = "abcdfgiklmnopqrstvwz|"
STRING T34 = "aclnuz|"
STRING T38 = "-dorsx|"
STRING T39 = "-cdu|"

   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "008" + "6"
   end if
   if instr(T21, substr(&P4,22,1)) = "" then
      message "1150" + "008" + "21"
   end if
   if instr(T22, substr(&P4,23,1)) = "" then
      message "1150" + "008" + "22"
   end if
   if instr(T21, substr(&P4,24,1)) = "" then
      message "1150" + "008" + "23"
   end if
   if instr(T21, substr(&P4,25,1)) = "" then
      message "1150" + "008" + "24"
   end if
   if instr(T21, substr(&P4,26,1)) = "" then
      message "1150" + "008" + "25"
   end if
   if instr(T21, substr(&P4,27,1)) = "" then
      message "1150" + "008" + "26"
   end if
   if instr(T21, substr(&P4,28,1)) = "" then
      message "1150" + "008" + "27"
   end if
   if instr(T28, substr(&P4,29,1)) = "" then
      message "1150" + "008" + "28"
   end if
   if instr(T29, substr(&P4,30,1)) = "" then
      message "1150" + "008" + "29"
   end if
   if instr(T21, substr(&P4,31,1)) = "" then
      message "1150" + "008" + "30"
   end if
   if instr(T21, substr(&P4,32,1)) = "" then
      message "1150" + "008" + "31"
   end if
   if instr(T21, substr(&P4,33,1)) = "" then
      message "1150" + "008" + "32"
   end if
   if instr(T33, substr(&P4,34,1)) = "" then
      message "1150" + "008" + "33"
   end if
   if instr(T34, substr(&P4,35,1)) = "" then
      message "1150" + "008" + "34"
   end if
   if instr(T38, substr(&P4,39,1)) = "" then
      message "1150" + "008" + "38"
   end if
   if instr(T39, substr(&P4,40,1)) = "" then
      message "1150" + "008" + "39"
   end if

end choose
end proc


proc CHECK008MX // MIXED MATERIALS

choose substr(&P1,3)
   case = "TIT" 

STRING T6 = "-bcdeikmnpqrstu|"
STRING T18 = "-|"
STRING T23 = "-abcdfrs|"
STRING T38 = "-dorsx|"
STRING T39 = "-cdu|"

   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "008" + "6"
   end if
   if instr(T18, substr(&P4,19,1)) = "" then
      message "1150" + "008" + "18"
   end if
   if instr(T18, substr(&P4,20,1)) = "" then
      message "1150" + "008" + "19"
   end if
   if instr(T18, substr(&P4,21,1)) = "" then
      message "1150" + "008" + "20"
   end if
   if instr(T18, substr(&P4,22,1)) = "" then
      message "1150" + "008" + "21"
   end if
   if instr(T18, substr(&P4,23,1)) = "" then
      message "1150" + "008" + "22"
   end if
   if instr(T23, substr(&P4,24,1)) = "" then
      message "1150" + "008" + "23"
   end if
   if instr(T18, substr(&P4,25,1)) = "" then
      message "1150" + "008" + "24"
   end if
   if instr(T18, substr(&P4,26,1)) = "" then
      message "1150" + "008" + "25"
   end if
   if instr(T18, substr(&P4,27,1)) = "" then
      message "1150" + "008" + "26"
   end if
   if instr(T18, substr(&P4,28,1)) = "" then
      message "1150" + "008" + "27"
   end if
   if instr(T18, substr(&P4,29,1)) = "" then
      message "1150" + "008" + "28"
   end if
   if instr(T18, substr(&P4,30,1)) = "" then
      message "1150" + "008" + "29"
   end if
   if instr(T18, substr(&P4,31,1)) = "" then
      message "1150" + "008" + "30"
   end if
   if instr(T18, substr(&P4,32,1)) = "" then
      message "1150" + "008" + "31"
   end if
   if instr(T18, substr(&P4,33,1)) = "" then
      message "1150" + "008" + "32"
   end if
   if instr(T18, substr(&P4,34,1)) = "" then
     message "1150" + "008" + "33"
   end if
   if instr(T18, substr(&P4,35,1)) = "" then
     message "1150" + "008" + "34"
   end if
   if instr(T38, substr(&P4,39,1)) = "" then
      message "1150" + "008" + "38"
   end if
   if instr(T39, substr(&P4,40,1)) = "" then
      message "1150" + "008" + "39"
   end if

end choose
end proc


proc CHECK008AU // AUTHORITIES

choose substr(&P1,3)
   case = "AUT" or = "SUB"
 
STRING T6 = "-din|"
STRING T7 = "abcdefgn|"
STRING T8 = "-bef|"
STRING T9 = "abcdefg|"
STRING T10 = "abcdnz|"
STRING T11 = "abcdknrsvz|"
STRING T12 = "abcnz|"
STRING T13 = "abcn|"
STRING T14 = "ab|"
STRING T17 = "abcden|"
STRING T18 = "-|"
STRING T28 = "-acfilmosuz|"
STRING T29 = "abn|"
STRING T33 = "abcdn|"
STRING T38 = "-sx|"
STRING T39 = "-cdu|"

   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "008" + "6"
   end if
   if instr(T7, substr(&P4,8,1)) = "" then
      message "1150" + "008" + "7"
   end if
   if instr(T8, substr(&P4,9,1)) = "" then
      message "1150" + "008" + "8"
   end if
   if instr(T9, substr(&P4,10,1)) = "" then
      message "1150" + "008" + "9"
   end if
   if instr(T10, substr(&P4,11,1)) = "" then
      message "1150" + "008" + "10"
   end if
   if instr(T11, substr(&P4,12,1)) = "" then
      message "1150" + "008" + "11"
   end if
   if instr(T12, substr(&P4,13,1)) = "" then
      message "1150" + "008" + "12"
   end if
   if instr(T13, substr(&P4,14,1)) = "" then
      message "1150" + "008" + "13"
   end if
   if instr(T14, substr(&P4,15,1)) = "" then
      message "1150" + "008" + "14"
   end if
   if instr(T14, substr(&P4,16,1)) = "" then
      message "1150" + "008" + "15"
   end if
   if instr(T14, substr(&P4,17,1)) = "" then
      message "1150" + "008" + "16"
   end if
   if instr(T17, substr(&P4,18,1)) = "" then
      message "1150" + "008" + "17"
   end if
   if instr(T18, substr(&P4,19,1)) = "" then
      message "1150" + "008" + "18"
   end if
   if instr(T18, substr(&P4,20,1)) = "" then
      message "1150" + "008" + "19"
   end if
   if instr(T18, substr(&P4,21,1)) = "" then
      message "1150" + "008" + "20"
   end if
   if instr(T18, substr(&P4,22,1)) = "" then
      message "1150" + "008" + "21"
   end if
   if instr(T18, substr(&P4,23,1)) = "" then
      message "1150" + "008" + "22"
   end if
   if instr(T18, substr(&P4,24,1)) = "" then
      message "1150" + "008" + "23"
   end if
   if instr(T18, substr(&P4,25,1)) = "" then
      message "1150" + "008" + "24"
   end if
   if instr(T18, substr(&P4,26,1)) = "" then
      message "1150" + "008" + "25"
   end if
   if instr(T18, substr(&P4,27,1)) = "" then
      message "1150" + "008" + "26"
   end if
   if instr(T18, substr(&P4,28,1)) = "" then
      message "1150" + "008" + "27"
   end if
   if instr(T28, substr(&P4,29,1)) = "" then
      message "1150" + "008" + "28"
   end if
   if instr(T29, substr(&P4,30,1)) = "" then
      message "1150" + "008" + "29"
   end if
   if instr(T18, substr(&P4,31,1)) = "" then
      message "1150" + "008" + "30"
   end if
   if instr(T14, substr(&P4,32,1)) = "" then
      message "1150" + "008" + "31"
   end if
   if instr(T29, substr(&P4,33,1)) = "" then
      message "1150" + "008" + "32"
   end if
   if instr(T33, substr(&P4,34,1)) = "" then
      message "1150" + "008" + "33"
   end if
   if instr(T18, substr(&P4,35,1)) = "" then
      message "1150" + "008" + "34"
   end if
   if instr(T18, substr(&P4,36,1)) = "" then
      message "1150" + "008" + "35"
   end if
   if instr(T18, substr(&P4,37,1)) = "" then
      message "1150" + "008" + "36"
   end if
   if instr(T18, substr(&P4,38,1)) = "" then
      message "1150" + "008" + "37"
   end if
   if instr(T38, substr(&P4,39,1)) = "" then
      message "1150" + "008" + "38"
   end if
   if instr(T39, substr(&P4,40,1)) = "" then
      message "1150" + "008" + "39"
   end if

end choose
end proc


proc CHECK008HO // HOLDINGS

choose substr(&P1,3)
   case = "HOL" 
 
STRING T6 = "012345|"
STRING T7 = "defgpzu|"
STRING T12 = "012345678|"
STRING T13 = "-1p|"
STRING T14 = "-123456789|"
STRING T15 = "-mwyeis|"
STRING T16 = "01234|"
STRING T20 = "abu|"
STRING T25 = "01|"

   if instr(T6, substr(&P4,7,1)) = "" then
      message "1150" + "008" + "6"
   end if
   if instr(T7, substr(&P4,8,1)) = "" then
      message "1150" + "008" + "7"
   end if
   if instr(T12, substr(&P4,13,1)) = "" then
      message "1150" + "008" + "12"
   end if
   if instr(T13, substr(&P4,14,1)) = "" then
      message "1150" + "008" + "13"
   end if
   if instr(T14, substr(&P4,15,1)) = "" then
      message "1150" + "008" + "14"
   end if
   if instr(T15, substr(&P4,16,1)) = "" then
      message "1150" + "008" + "15"
   end if
   if instr(T16, substr(&P4,17,1)) = "" then
      message "1150" + "008" + "16"
   end if
   if instr(T20, substr(&P4,21,1)) = "" then
      message "1150" + "008" + "20"
   end if
   if instr(T20, substr(&P4,22,1)) = "" then
      message "1150" + "008" + "21"
   end if
   if instr(T25, substr(&P4,26,1)) = "" then
      message "1150" + "008" + "25"
   end if

end choose
end proc
