CPYTOPCD EOF marker
Last Post 04 Mar 2013 10:07 AM by Scott Klement. 2 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
macie
New Member
New Member
Posts:1

--
01 Mar 2013 08:48 PM

Hi.  I'm currently new with RPGLE programming.  I have a file that I need to convert to text file.  However, there's a character at the end of file which is why the other system is rejecting.  I'm currently using CPYTOPCD and the following is my program:

CPYTOPCD FROMFILE(&FAYL) TOFLR(&MWEB) TODOC(&OUTF) REPLACE(*YES)

 

Thomas Sullivan
New Member
New Member
Posts:44

--
02 Mar 2013 04:53 AM

From the CPYTOPCD online documentation:

Format of PC data (TRNFMT)

Specifies the format the records in the PC document are to have.

This parameter is not valid if *NONE is specified on the Translate table prompt (TRNTBL parameter).

*TEXT
The records in the PC document will be written in standard DOS ASCII variable length format. The ASCII carriage return and line feed characters are added to the end of each record, and the ASCII end of file character is added to the end of the PC document.
*NOTEXT
The records in the PC document will be fixed length records. The length of the records in the database file is used for the length of the records in the PC document.

The end of file marker (ASCII Ctrl-Z) is what you don't want.  However, changing the default value of TRANFMT from *TEXT to *NOTEXT will make each line the same length by padding each line with blanks.

 You might want to use CPYTOIMPF, instead.  Google for examples.

Scott Klement
Editorial Staff Member
Editorial Staff Member
Posts:16387
Avatar

--
04 Mar 2013 10:07 AM

Or CPYTOSTMF, which is more like CPYTOPCD.

 

You are not authorized to post a reply.

Acceptable Use Policy