3 Replies Latest reply: May 15, 2014 10:02 AM by Grant Perkins RSS

    Combination of floating trap with optional multiple lines

    ChristD _

      I am using a report in which all fields have a variable length. With the floating trap it captures the data nicely from the report.

      In some instances the detail line includes one or more extra lines and I don't get the traps to work to capture these details correctly.

       

      The report looks like this:

       

      :CnTy:Material:Material :S:Scale qty:UoM:Amount:Unit:per:UoM:Valid on  :Valid to  :           -


      :PR00:K12345  :Product C  :         :   :16.21 :EUR : 1 :KG :01.08.2008:31.12.2999:

      -


      Customer             0000000006          ABC UK Ltd

                                                                                      -


      :CnTy:Material:Material            :S:Scale qty:UoM:Amount:Unit:per:UoM:Valid on  :Valid to  :

      -


      :PR00:K23456  :Product A           : :         :   :18.91 :GBP : 1 :KG :29.08.2008:31.12.2999:

      :PR00:K23457  :Product B           : :         :   : 4.55 :GBP : 1 :KG :01.08.2008:31.12.2999:

      :PR00:K23458  :Product C           : :         :   : 4.91 :GBP : 1 :KG :01.08.2008:31.12.2999:

      :PR00:K23459  :Product D           : :         :   : 4.79 :GBP : 1 :KG :01.08.2008:31.12.2999:

      :PR00:K34567  :Product E           : :         :   : 5.44 :GBP : 1 :KG :01.08.2008:31.12.2999:

      -


      Customer             0000000008         Scotland Ltd                                                                               

      -


                             

      :CnTy:Material:Material:S   :      Scale quantity:UoM: Rate:Unit:per:UoM:Valid on  :Valid to  :                     

      -


                             

      :PR00:K65432  :Product F :    :                 :   :6.71 :EUR : 1 :KG :01.08.2008:31.12.2999:

      :PR00:K95000  :Product G :From:            1.000:KG :6.91 :EUR : 1 :KG :19.02.2008:31.12.2008:

      :    :        :        :    :          2,000.000:   :6.53 :    :  :   :          :          :

      /CODE

       

      Who could help out here?

       

      Regards,

       

      Chris

      V9 Pro

        • Combination of floating trap with optional multiple lines
          Grant Perkins

          Chris,

           

          If the extra line for a record that gives your problem is represented by the last line in your sample, I think the answer is that you can't do anything directly with the Advanced field settings using V9. The floating trap is a special case that disallows the advanced features.

           

          My first thought here would be to re-work the report (using Monarch and an export to a new file) to eliminate the field width variability. Then you would have an easy report to work with.

           

          However, V10 Monarch does allow the advanced properties of a field to be used with a floating trap, though there are some logical restrictions on how the trap line within a multi-line data sample can be set.

           

          I need to do some more checking to see if the new facility will cope with your particular report - floating trap logic must be getting rather complex these days - but will do so if an upgrade to V10 is an option for you.

           

           

          If V10 is NOT an option then I think I would produce a modified file by selecting entire lines as a single field and in the table slice and dice it using LSPLIT() , splitting at the colons, and then export the resulting table as a fixed width column report (having filtered out unrequired lines).

           

          Monarch the new report and the model should be quite straightforward.

           

          HTH.

           

           

          Grant

            • Combination of floating trap with optional multiple lines
              ChristD _

              Grant,

               

              I have already ordered the upgrade to V10, but have not received it yet.

              So it would be worth while to know whether this would work in V10.

               

              Regards,

               

              Chris

                • Combination of floating trap with optional multiple lines
                  Grant Perkins

                  Chris,

                   

                  Hmm. As far as I can see I can get the floating trap to work well on your report (although for safety I would create a 'dummy' data sample line that defines for the widest possible fields in any column rather than selecting any of the available lines as samples.) but not with any of the multi-line advanced properties.

                   

                  I think, given that the multi-line fields would in any case need to be further interpreted using calculated fields, you may as well think in terms of a 2 step process - it would quicker to develop! I may have missed something but right now I can't think what. If I get to to a successful solution I will post it.

                   

                  Just grab entire lines from the report  (a template with no trap character defined) as a single field and then slice and dice using the most appropriate SPLIT() function with : as the split identication character.

                   

                  Export the resulting table (using a non-proportional font) as a fixed width 'report' and then parse that with a simple Monarch model without involving floating traps.

                   

                  You wouold then have the choice of treating each line with a value as a separate detail record and append the values from the first 2 or 3 columns OR using the multi-line field and then further splitting it if required but bear in mind that if there can be a variable number of additional lines you will need to create as many extra fields as MAY BE POSSIBLE to find in some future version of the report, so some research might be required.

                   

                  Which route you choose will depend on what and how you need to output.

                   

                   

                  HTH.

                   

                   

                  Grant