title: AS400 cpyf not copying a character record
body: <p>I am trying to copy all of the records from a data file (STUDMARKS) into my physical file (MARKS) using the CPYF command.</p>
  
  <pre><code> A          R MARKSR                    TEXT('Marks Records')
   A            STUDENTID      9S 0       COLHDG('Student' 'ID')
   A            COURSE_CD      6A         COLHDG('Course' 'Code')
   A            FINAL_MARK     3S         COLHDG('Final' 'Mark')
   A            DATERUN         L         COLHDG('Date' 'Run')
   A          K STUDENTID
   A          K COURSE_CD 
  </code></pre>
  
  <p>This is what I currently have in my MARKS.pf. The STUDMARKS.pf-dta file has the first three records already defined, the DATERUN record get filled with the date of use.</p>
  
  <pre><code>CPYF FROMFILE(IBC233LIB/STUDMARKS) TOFILE(DS233B32/MARKS) MBROPT(*REPLACE) FMTOPT(*MAP *DROP)
  </code></pre>
  
  <p>The above is the CPYF command that I ran after creating MARKS.pf, and after doing a RUNQRY to see all the records I've noticed that all but the COURSE_CD have been filled. COURSE_CD is completely blank. </p>
  
  <p>I did some research before hand and did a DSPFFD on both members to ensure that the record lengths and types were all the same, which they were. I did notice, however, that in STUDMARKS.pf-dta that all the records had a buffer length which was equivalent to the field length. The STUDENTID field in MARKS.pf was the only one to not share this property, where the field length is 9, but the buffer length is only 5. I'm not sure if it's the reason why I'm having such difficulty, and the matter is almost certainly less so than what I'm making it out to be, but I've been at this for quite some time and a just can't seem to copy records from one member to another.</p>
  
  <p>It's incredibly frustrating, and help would be greatly appreciated</p>
  
  <hr>
  
  <p>I took screen shots of the DSPFFD commands for both files</p>
  
  <p>For STUDMARKS<img src="https://i.stack.imgur.com/9VthH.png" alt="Screen Shot of DSPFFD StudMarks"></p>
  
  <p>And For MARKS<img src="https://i.stack.imgur.com/bQmxk.png" alt="enter image description here"></p>
  
  <p>EDIT
    Just now seeing the spelling error! Smashing my head against the desk but I almost guarantee that is the problem. All of your answers were very informative and helpful though, so thank you very much </p>
  
  <p>EDITEDIT
  for others, despite the fact that I did change the names when recompiling the program, it will not work unless you delete the file first and THEN compile it. Very frustrating, but that's just how it is...</p>
  
  <p>So <code>DLTF [file name]</code> and then recompile</p>