How do I create msgs end with n and nr?

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf How do I create msgs end with n and nr?

  • Creator
    Topic
  • #47948
    Rentian Huang
    Participant

      Greetings Cloverleafers!!!

      Quovadx 5.2 on AIX, VRL => FRL

      I am creating a msg based on each of a VRL line, and the requirement for output file(FRL) is:

      msg1: orderHeader (ends with n, Newline)

      msg2: orderLineItem1 (ends with n)

      msg3: orderLineItem2 (ends with n)

      msg4: orderLineItem3 (ends with n)

      msgN: orderLineItem10 (ends with nr, Newline and Carriage Return)

      I mannually put an nr by:

      set msg LNE;${msg}nr

      lappend msgList “CONTINUE [msgcreate -type data $msg]”

      but in the output, I didn’t see the r.

      My questions is:

      1. How do I create msgs end with n and msgs end with nr?

      2. When I do a msgcreate, does the engine automatically puts an n at the end of it?

      Attched is my code, Thanks guys!

      Good day,

      Sam ^^

    Viewing 2 reply threads
    • Author
      Replies
      • #57139
        Jonathan Hamilton
        Participant

          >>1. How do I create msgs end with n and msgs end with nr?

          set mh [msgcreate -recover “yada yada yada badan”]

          set mh [msgcreate -recover “${msgData}nr”]

          >>2. When I do a msgcreate, does the engine automatically puts an n at the end of it?

          The msgcreate command doesn’t add anything to the data string.  If you are using a file based protocol it’s possible the protocol is adding a newline to the end of your file though.

          If you want to see the carriage return or newline in your message use msgdump to view the message.  Instead of interpreting special characters message dump will display them in hex so you should see x0d for r and x0a for n.  Additionally, you can use hcihd to view a hex dump of a file to verify it after processing.

        • #57140
          Charlie Bursell
          Participant

            I don’t think msgcreate is what you want here.  There are only two places I *EVER*  use msgcreate;  reply message and in a read UPoC proc.

            The problem is you have no metadata.  You will invariably crash the engine even if you try to build your own.

            Use msgcopy instead.  For example

            set nmh [msgcopy $mh]

            msgset $nmh $newmsg

            A good tip:

            If the IB message is large, first get a copy of the IB msg then clear the message handle so that with each msgcopy you are not copying a large message that will subsequently get over-written.  For example

            set msg [msgget $mh]

            msgset $mh “”

            Then do the msgcopy commands

          • #57141
            Rentian Huang
            Participant

              Thanks for your info. Jonathan and Charlie, they are very helpful!

              Sorry I didn’t mention that the incoming msgs are in a file with EOF(1 msg only in the while file). I guess that I was in the wrong track??? I should put a Post Procs after the translation to add a n and nr respectively to the FRL coming out of the xlate, adding n or nr to the incoming msgs to the xlate shouldn’t have any effect on the outcoming msg of the xlate(VRL -> FRL).

              Am I right?

              Sam  ðŸ˜‰

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