3 Replies Latest reply: May 15, 2014 9:51 AM by Grant Perkins RSS

    Field Data  truncated when reading a text file

    PYelton _

      Using Monarch 8.01

       

      I am using Monarch to read and write text files.  The problem is that it seems to be truncating some of the field data.  For example, I have a file where the very first field is Vendor Code which should be unique.  Two lines appear in the Monarch table view with the same Vendor Code of "01AMER".  When I inspected the source, it turns out that one of the records was actually "01AMERI".  If I change the field attributes from Character to Memo, the correct value displays.

       

      I created a test file with just these 2 records and it works correctly, so I am assuming the Monarch is "polling" a set number of records to guess the field length.  If so, can value this be changed?  Otherwise it would seem that I need to change all Character fields to Memo to be sure that nothing is truncated.

       

      Thanks for any help.

        • Field Data  truncated when reading a text file
          Grant Perkins

          Hi,

           

          You should be able to amend the size of the number of DATA characters for the field and the DISPLAY width. I think the Memo fields set a larger base field template size by default.

           

          I would be tempted to use the VERIFY routine as well to see what it gives you by way of help.

           

          HTH.

           

           

          Grant

          • Field Data  truncated when reading a text file
            PYelton _

            Thanks for the reply, Grant, but I'm using Monarch to "Open a Database" and read in a delimited file (in this case  it's pipe delimited).  The "Verify" option doesn't pertain to this unless there's something I'm missing.

             

            I know I can change the field widths after reading in the table, but this would require that I know the lengths of all the fields and manually setting all of the fields before I can trust the data.

             

            Since Monarch must be polling a certain number of records in order to set field types and lengths, I'm just wondering if there is a way to increase the size of the poll (or some other option)?

             

            Thanks for any help.

            • Field Data  truncated when reading a text file
              Grant Perkins

              Originally posted by PYelton:

              Thanks for the reply, Grant, but I'm using Monarch to "Open a Database" and read in a delimited file (in this case  it's pipe delimited).  The "Verify" option doesn't pertain to this unless there's something I'm missing.[/b][/quote]I did wonder but ...

               

              You're right, verify dos not apply here.

               

               

              Originally posted by PYelton:

              I know I can change the field widths after reading in the table, but this would require that I know the lengths of all the fields and manually setting all of the fields before I can trust the data.[/b][/quote]True.

               

              But, if you plan to save a model to re-use for the future, identifying and setting the max possible field widths does overcome the uncertainty of whether the sample report you have used for the model is indeed adequately representative of the data that may be presented. If you save the model the values are fixed until or unless you re-check it.

               

              My personal experiences led me to either seek out the data structure and use that or set the values ssuch that they were unlikely ever to be too small.

               

              Originally posted by PYelton:

               

              Since Monarch must be polling a certain number of records in order to set field types and lengths, I'm just wondering if there is a way to increase the size of the poll (or some other option)?

               

              Thanks for any help. /b[/quote]You could concatenate the file to a single line file (thus making a 'header' line) that defines the field sizes you expect - but then that hardly matters once you have an adjusted model anyway. It was of more value prior to V8.

               

              There almost certainly is a way change the number of lines assessed but it may not be user accessible.

               

              HTH.

               

               

              Grant