CR/LF in FRL

  • Creator
    Topic
  • #52030
    George Kulz
    Participant

    Hi all.

    I was wondering if there is a way to use the translator to define a CR/LF at the end of every FRL in an HRL. So after every repeated FRL piece, I want a CR/LF there before the next one. For some reason, this doesn’t happen automatically. Also, I tried defining some placeholder fields in the FRL for CR and for LF and tried using CR for the fill character of one and LF for the fill character of the other, and this didn’t work. I don’t know how to use the translator to copy a CR or a LF into these placeholder fields.

    Thanks.

    George Kulz

    Senior Java Programmer

    Memorial Hospital of Rhode Island

Viewing 9 reply threads
  • Author
    Replies
    • #72785
      Jim Kosloskey
      Participant

      George,

      It is unusual to see CR/LF after each FRL component of an HRL (after all the knowledge of the length tells one where things end.

      However, I have never tried to use the x0d fill character in the FRL definition.

      What I have done is to COPY =x0d to the placeholder in an FRL definition and that works.

      You could do the same with the x0a but check carefully because your last segment of the HRL may have a x0a automatically placed there for you.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #72786
      George Kulz
      Participant

      Jim

      Thank you. This seemed to work just fine. The system processing the flat file on the other end wants to see CR/LF after every single line in the flat file, which is why I needed to put them in myself.

      -George

    • #72787
      Jeff Anderson
      Participant

      What I’ve done is use a mask for this:

      {NAME line_feed} {TYPE mask} { FMT {

         { FILL {} }

         { JUST l }

         { OFFSET {} }

         { SFDATA {

             {

                 { DATATYPE ch }

                 { FILL {x0a} }

                 { IN_VERIFY 0 }

                 { JUST l }

                 { OUT_VERIFY 0 }

                 { PREFIX {} }

                 { WIDTH 1 }

             }

         }}

         { WHEN_VERIFY f }

         { WIDTH 1 }

      }}

      And then call it in the FRL

      {NAME lf_1} {TYPE maskuse} {MASK line_feed}

      Hope this helps,

      Jeff

    • #72788
      Jim Kosloskey
      Participant

      Jeff,

      Does the mask work even if nothing is copied to the field in an Xlate?

      I did not try a mask but when I just defined a fill at the field (or sub-field) level nothing gets filled unless I COPY something less than the length of the field (naturally to test thagt I needed to make the field longer than 1 character).

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #72789
      Jeff Anderson
      Participant

      Yes, what I do in the Xlate is copy @null into the line-feed, like so:

      { { OP COPY }

         { ERR 0 }

         { IN @null }

         { OUT hdr_lf }

      }

    • #72790
      Jim Kosloskey
      Participant

      Jeff,

      Does the mask work even if nothing is copied to the field in an Xlate?

      I did not try a mask but when I just defined a fill at the field (or sub-field) level nothing gets filled unless I COPY something less than the length of the field (naturally to test thagt I needed to make the field longer than 1 character).

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #72791
      Jim Kosloskey
      Participant

      Sorry for the repeated post – not sure what happened there.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #72792
      Jim Kosloskey
      Participant

      George,

      based on your reply and some other information I think what you needed to do initially was to create multiple Flat records from one HL/7 message.

      Thus the need for CR/LF after each FRL

      Obviously you could not have one Xlate specify multiple outbound FRL definitions – BUT – HRL allows you that luxury. You just needed to accomodate the CR/LF issue.

      So although to the Xlate this looks like one message to one message (HL/7 to HRL) from a file standpoint it looks like one HL/7 created multiple FRLs in the correct order. Each FRL then treated as a separate message (record) by the receiving system.

      There might be an additional solution available in 5.8 with the stacked Xlate capability. Not necessarily better just different.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #72793
      Jim Kosloskey
      Participant

      Jeff,

      Hmm so that COPY @null might work with fill definitions at the field level without a mask.

      When I have time I think I will give that a try.

      Then there are at least 3 ways to solve the issue.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #72794
      George Kulz
      Participant

      Thank you all for your responses.

      Jeff, I’m not familiar with using masks at all, but if I have time I might try that solution. Your example will be a good exercise in learning how to use them. My guess is that for now I’ll have to write myself a note regarding this and move on since it works at the moment and I’m on a tight deadline to finish this.

Viewing 9 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,297
Replies
34,439
Topic Tags
287
Empty Topic Tags
10