title: Write a Cobol copybook?
body: <p>I'm using a copybook that needs records added to it..</p>
  
  <p>Is it possible to move records to the copybook record and then write out the copybook in COBOL?
  If so, any references on how to do this? </p>
  
  <p>I have this code (based on the answer to this question), which is working correctly, however I was told I don't need TRNREC94-OUT, that I can just write the TRNREC94 copybook. When I tried replacing B700-MOVE-RECORDS with "WRITE REPORT-RECORD FROM TRNREC94." I get an error saying that TRNREC94 was not defined as a data-name and was discarded. Not sure where to go from here..</p>
  
  <pre><code> WORKING-STORAGE SECTION.                    
  
   COPY TRNREC94.                          
  
   01  TRNREC94-OUT.                           
       05 REC-94-TYPE-OUT           PIC X(2).  
       05 REC-94-POLICY-NUMBER-OUT  PIC X(8).  
       05 FILLER                    PIC X(5).  
       05 REC-94-PARISH-CODE-OUT    PIC X(3).  
       05 FILLER                    PIC X(1).  
       05 REC-94-TERRITORY-CODE-OUT PIC X(1).  
       05 FILLER                    PIC X(60). 
  
  ...
  ...
  
   B700-MOVE-RECORDS.                                          
       MOVE REC-94-TYPE TO REC-94-TYPE-OUT                     
       MOVE REC-94-POLICY-NUMBER TO REC-94-POLICY-NUMBER-OUT   
       MOVE REC-94-PARISH-CODE TO REC-94-PARISH-CODE-OUT       
       MOVE REC-94-TERRITORY-CODE TO REC-94-TERRITORY-CODE-OUT 
       WRITE REPORT-RECORD FROM TRNREC94-OUT.                  
  </code></pre>