Topic
  • 3 replies
  • Latest Post - ‏2014-07-11T23:43:21Z by tomliotta
system3
system3
1 Post

Pinned topic stripping out Record delimiter(RCDDLM)

‏2014-07-04T14:56:26Z |

I copied an IBMi DB file to IFS using CPYTOIMPF command. The copy was successful except the .txt file I created has Record delimiter(RCDDLM) inserted at the end if each record. Is there a way to remove those *LF characters. I want a .txt file with one long string no matter how many records I have in  file the DB file.

thanks.

  • tomliotta
    tomliotta
    27 Posts

    Re: stripping out Record delimiter(RCDDLM)

    ‏2014-07-06T05:45:51Z  

    It's not clear why this is posted in an RPG forum. Are you wanting to know how to write an ILE RPG program to do this? Or do you simply want some way to strip newline characters from a streamfile?

    If I just wanted to strip newlines, I might use the Qshell  tr - Translate characters utility.

    >  tr -d '\n' < my.csv > myNoLF.txt

    That example removes newlines from a streamfile named my.csv and copies the rest of the characters to a streamfile named myNoLF.txt.

    It could be better not to put newlines into the file at all if you don't want them, but that implies not using a command such as CPYTOIMPF which is intended as a standard database export command.

    Tom

  • C1EF_T-Jay_Waldock
    C1EF_T-Jay_Waldock
    14 Posts

    Re: stripping out Record delimiter(RCDDLM)

    ‏2014-07-10T20:36:50Z  

    Try using RCDDLM(*EOR)

  • tomliotta
    tomliotta
    27 Posts

    Re: stripping out Record delimiter(RCDDLM)

    ‏2014-07-11T23:43:21Z  

    Try using RCDDLM(*EOR)

    Unfortunately, RCDDLM(*EOR) is only available for output to a physical file (at least, up to i 7.2). It can't be used for a streamfile (".txt file"). There are times when it'd be nice to have, but it's usually easy enough to write code to do it yourself or simply to remove any end-of-line characters.

    Tom