2 Replies Latest reply: May 15, 2014 10:11 AM by Kristie _ RSS

    Pull fields from data file to create 80 character string.

    Kristie _

      Hi, I am using Monarch 10.5 and need to take this string for example:

      00936718 0042 +00000002.10 "08/01/11"" ""                                                " 000000936718 0000000032171800 02[/code]

      and make it look like this:

      066006066660800000000000936718020110801000000000000210000 OC00000000000000000000[/code]


      I need to add extra characters that are not in the original file, reverse the date and take the decimal out of the amount.  Can I do all of this Monarch?  I am most concerned about the date and amount, not sure where to start for those if possible.

      Thanks in advance for any help.

        • Pull fields from data file to create 80 character string.
          Olly Bond

          Hello Kristie,


          Yes, you can. In the definition dialog for a calculated field, you'll see in the top right corner a selection pull-down for types of functions. One of these is Conversion, where you'll find things like dtoc and str.


          dtoc stands for "date to character", and str (string) converts numbers to characters. Both functions offer various arguments - so you can pad out a number to n places with leading zeroes for example.


          You can make it slightly easier by working in steps - define one field as dtoc(), and then string them together to make the final output. Joining strings in Monarch is simple =[PartA]+.


          Hope this helps,