Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

CPYTOIMPF - to Text Delimited

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CPYTOIMPF - to Text Delimited

    I copied a PF to text delimited file in IFS using the Command below. The data looked good when view in IFS Folder all the fields line up properly but when viewed in Windows Explorer, the format is not lining up correctly. The next record continues to the last position of the first record. One of the field in the file contains Carriage Return and underlines, because this is imported from a web application and copied to AS400 PF. When I used RCDDLM(*CRLF) the fields that contains CR is adding new line on the text file. We are on V5R4M0. Any help will be greatly appreciated.
    CPYTOIMPF FROMFILE(PSFCLRIFY) TOSTMF('/FTPFILE/TestFile.txt') MBROPT(*REPLACE) STMFCODPAG(*PCASCII) RCDDLM(*LFCR) DTAFMT(*DLM) STRDLM(*NONE) RMVBLANK(*NONE) FLDDLM('|')

    Thank you... REC

  • #2
    Hi

    Try specifying something for the STRDLM keyword. But if you have Carriage Return in a data field, you are telling Windows to add a new line at that point.

    Jørn

    Comment


    • #3
      Hello! I think Jørn is right, in that the carriage return is causing you a problem. What you could try, is to create a logical file over the physical that does not include the field with the carriage return. Then, I think you can try this:

      CPYTOIMPF FROMFILE(TheLogical)
      TOSTMF('/FTPFILE/TestFile.txt')
      MBROPT(*REPLACE)
      STMFCODPAG(*PCASCII)
      RCDDLM(*CRLF)
      DTAFMT(*DLM)
      STRDLM(*NONE)
      STRESCCHR(*NONE)
      RMVBLANK(*BOTH)
      FLDDLM('|')

      This gives me a good looking file when viewed from Window Explorer via Notepad.

      Post back if you get your problem solved.

      Bruce

      Comment

      Working...
      X