title: Invalid type cast from 'null'
body: <p>I am still new to COBOL and have been working on a project for school for almost a week now.  I am running OpenCobol 1.1.
  When I try to compile it I get this error.</p>
  
  <pre><code>typeck.c:5912: Invalid type cast from 'null'
  Tag 1 0 Tag 2 10
  Aborting compile of lab4.cob at line 214
  </code></pre>
  
  <p>I've been frustrated because I've tried changing the code around a lot with no luck.  </p>
  
  <pre><code>Procedure Division.
     000-Main.
          Perform 100-initialize
  
          Perform Until EndOfFile = "Y"
             Read Lab4-in-File
                At End
                   Move "Y" To EndOfFile
                Not At End
                   Perform 300-process
             End-Read
          End-Perform
  
          Perform 900-finalize
  
          Stop Run.
  
     100-intialize.
         Perform 110-open-files
         Perform 120-get-data.
  
     110-open-files.
         Open Input Lab4-in-File
            Output Ot-File.
  
     120-get-date.
         Accept WS-date from date yyyymmdd
  
         Move WS-Year To PH-Year
         Move WS-Month To PH-Month
         Move WS-Day To PH-Day.
  
     300-process.
         Move Dept-no To dl-dep-no
         Move Employee-no To dl-emp-no
         If First-name Not = "Null"
            String First-name Delimited By Size
                  " " Delimited By Size
                  Last-name Delimited By Size 
                  Into dl-emp
         else 
            Move Last-name To dl-emp
         End-If     
         Move Job-title To dl-job
         Move DOH To dl-doh
         Move Mar-status To dl-marital
         Move Dependents To dl-dependents
         Move MCoverage To dl-insurance
         Move DCoverage To dl-insurance
         Move VCoverage To dl-insurance
         Move 401K To dl-401k
         Move Pay-code To dl-pay-code
         If Pay-code = "C" Or "S"
            Compute Pay-hold rounded = 
                 Pay / 12
            Move Pay-hold To dl-monthly-pay
         else
            Compute Pay-hold rounded =
                 Pay * HPW * 4
            Move Pay-hold To dl-monthly-pay
         End-If
  
         If Pay-code = "C"
            Compute Com-hold rounded =
                 Act-sale * C-rate
            Move Com-hold To dl-commission
         Else
            Move 0 To dl-commission
         End-If
  
         Perform 800-print
  
         Multiply C-rate By Act-sale Giving 
             total-sales
  
         Add Pay To total-sales.
  
     800-print.
         If LineNum &gt; LinesPerPage
            Perform 825-new-page
         End-If
  
         Write Lab4-Record2 From Detail-Line
              **After advancing 1 line**     *&gt; This is line 214     
  
         Add 1 To LineNum.
  
     825-new-page.
         If PageNum &gt; 0
            Write Lab4-Record2 From Blank-line
                After advancing 1 line
         End-If
  
         Add 1 To PageNum
         Move PageNum To PH-PageNo
  
         Write Lab4-Record2 From Page-Header
             After advancing page
  
         Write Lab4-Record2 From Blank-line
             After advancing 1 line
  
         Write Lab4-Record2 From Column-Header
             After advancing 1 line
  
         Write Lab4-Record2 From Blank-line
             After advancing 1 line
  
         Move 5 To LineNum.
  
     900-finalize.
         Perform 950-print-monthly-total
         Perform 999-close-files.
  
     950-print-monthly-total.
         If LineNum + 1 &gt; LinesPerPage
            Perform 825-new-page
         End-If
  
         Write Lab4-Record2 From Blank-line
             After advancing 1 line
  
         Move total-sales To Total-pay
  
         Write Lab4-Record2 From Total-Line
             After advancing 1 line
  
         Add 2 To LineNum.
  
     999-close-files.
         Close Lab4-in-File Ot-File.
  </code></pre>
  
  <p>I would really appreciate it if someone could help me find what is causing the error.  Thanks in advance!  </p>
  
  <pre><code>Working-Storage Section.
     01  EndOfFile        Pic X Value "N".
  
     01  Report-fields.
         05  PageNum           Pic 9(3)  value 0.
         05  LinesPerPage      Pic 9(2)  value 40.
         05  LineNum           Pic 9(2)  value 41.
  
     01  WS-date.
         05  WS-Year           Pic 9(4).
         05  WS-Month          Pic 99.
         05  WS-Day            Pic 99.
  
     01  total-fields. 
         05  total-sales       Pic 9(11)v99 Value 0.
  
     01  Page-Header.
         05  PH-Month          Pic Z9/.
         05  PH-Day            Pic 99/.
         05  PH-Year           Pic 9999.
         05                    Pic X(7) Value Spaces.
         05                    Pic X(29) Value "Stomper &amp;" &amp;
                                   " Wombat's Emporium"
         05                    Pic X(6) Value "Page:".
         05  PH-PageNo         Pic ZZ9.
  
     01  Column-Header.
         05                    Pic X(8) Value "Dep #".
         05                    Pic X(15) Value "Emp #".
         05                    Pic X(27) Value "Employee".
         05                    Pic X(18) Value "Title".
         05                    Pic X(9) Value "DOH".
         05                    Pic X(9) Value "Marital".
         05                    Pic X(7) Value "#Deps".
         05                    Pic X(6) Value "Ins".
         05                    Pic X(6) Value "401K".
         05                    Pic X(6) Value "Pay".
         05                    Pic X(27) Value "Expected " &amp;
                                    "Pay  +  Commission".
  
     01  Pay-hold              Pic 9(9)V9(2) Value 0.    
     01  Com-hold              Pic 9(9)V9(2) Value 0.
  
     01  Detail-Line.
         05  dl-dep-no         Pic X(5).
         05                    Pic X(1) Value spaces.
         05  dl-emp-no         Pic X(5).
         05                    Pic X(1) Value spaces.
         05  dl-emp            Pic X(35).
         05                    Pic X(1) Value spaces.
         05  dl-job            Pic X(20).
         05                    Pic X(1) Value spaces.
         05  dl-doh            Pic X(8).
         05                    Pic X(1) Value spaces.
         05  dl-marital        Pic X.
         05                    Pic X(1) Value spaces.
         05  dl-dependents     Pic 9(2).
         05                    Pic X(1) Value spaces.
         05  dl-insurance      Pic X(3).
         05                    Pic X(1) Value spaces.
         05  dl-401k           Pic Z.9ZZ.
         05                    Pic X(1) Value spaces.
         05  dl-pay-code       Pic X.
         05                    Pic X(1) Value spaces.
         05  dl-monthly-pay    Pic $$$$,$$$,$$9.99.
         05                    Pic X(1) Value spaces.
         05  dl-commission     Pic $$$,$$9.99.
  
  
     01  Total-Line.
         05                    Pic X(61) Value Spaces.
         05                    Pic X(24) Value "Total" &amp; 
         " Expected Payroll: ".
         05  Total-pay         Pic $$$$,$$$,$$$,$$9.99.
  
     01  Blank-line            Pic X Value spaces.
  </code></pre>