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

    Create 2 Models with Multiple lines

    YANECKC _

      I just had Monarch (TM) ver 9.01 installed on my computer and I am new to creating models.

      I want to create two Models.

      My text file has three kinds of detail lines.

       

      MODEL1

      If the line starts with F57 I need to extract bytes 10-13 call it ID1, extract bytes 14-22 call it ID2,  extract bytes 23-30 call it DATE.

      If the line starts with F59 I need to extract bytes 10-25 call it AMOUNT.

      (For each record that should only be one F57 line and one F59 line)

      (Using sample below the first record should be

      ID1=5715   ID2=C29163345   DATE=04112008   AMOUNT=0000001916989700)

       

      MODEL2

      If the line starts with F57 I need to extract bytes 10-13 call it ID1, extract bytes 14-22 call it ID2,  extract bytes 23-30 call it DATE.

      If the line starts with F58 I need to extract bytes 8-17 call it ACCOUNT, extract bytes 25-38 call it AMOUNT.

      (For each record that should only be one F57 line but you can have one or many F58 lines)

      (Using sample below the first record should be

      ID1=5715   ID2=C29163345   DATE=04112008   ACCOUNT=8144192215   AMOUNT=00000538489700)

       

       

      See sample of text file below

       

      F57  08525715C2916334504112008    0852                                                      

      F58 0208144192215       00000538489700000000000000113EKBR000005422510419     0000000000007533

      F58 0208144211312       00000406600000000000000000103EKBR000005422509557     0000000000005688

      F58 0208144212815       00000304900000000000000000103EKBR000005422509506     0000000000004265

      F58 0208144217319       00000667000000000000000000103EKBR000005422509850     0000000000009331

      F590108520000001916989700000000000000000000600000004    000000000000000                     

      F57  08525715C2916340204112008    0852                                                      

      F58 0208897534917       00000525182800000000000000113EKBR000007987924831     0000000000007991

      F590108520000000525182800000000000000000000300000001    000000000000000                     

      F57  08525715C2916343604112008    0852                                                      

      F58 0208687254712       00000111685300000000000000133EKBR000005488807305     0000000000002241

      F58 0208687257715       00000155507900000000000000113EKBR000005488809107     0000000000003121

      F590108520000000267193200000000000000000000400000002    000000000000000                     

      F57  08525715C2916344404112008    0852                                                      

      F58 0208488849613       00000353248600000000000000113EKBR000005488902573     0000000000006587

      F58 0209190190815       00000236278800000000000000113EKBR000005488904983     0000000000004406

      F58 0209190193512       00000236278800000000000000113EKBR000005488904995     0000000000004406

      F58 0209190199311       00000302078000000000000000133EKBR000005488905000     0000000000005633

      F590108520000001127884200000000000000000000600000004    000000000000000                     

       

      Yaneckc

        • Create 2 Models with Multiple lines
          Grant Perkins

          Hi YANECKC and welcome to the forum.

           

          Have you had a chance to spend a little time with the Learning Guide that, hopefully, will have been installed as a PDF file along with Monarch? If not I would highly recommend it as a quick way to become familiar with what you need to do. Chapters 1 and 2 should be all you need to answer your questions in general terms.

           

          Once you have read those chapters (or if you have already read them) then the following may make some sense.

           

          Model 1.

           

          Create a DETAIL template for the F57 lines that traps using F57. 'Paint' the fields where they need to be as you know they will always be in the same place and name them as you need them.

           

          Then Create an APPEND template but make it a FOOTER type and trap using F59 at the beginning of the line. Paint fields and name as required.

           

           

          Model 2

           

          Take Model 1 and save it with a new name.

           

          Delete the FOOTER and change the DETAIL template to be an APPEND template. (Radio button in the Template definition screen.)

           

          Create a new TEMPLATE for the F58 lines as a DETAIL template, painting the field positions as you have already identified them.

           

           

          That's it.

           

           

           

          Further thoughts for AFTER you have worked with the suggestions above.

           

          You could avoid having 2 models by making the F59 lines Footers in model 2 and then presenting either full detail or Model 1 level detail as required.

           

          One way to to that would be to use SUMMARIES (See Learning Guide Chapter 10) and either have Monarch calculate the totals for you as part of the summary activity (which you can do anyway from the Model 2 described above)  OR include the F59 lines as well and then have Monarch display on those values in the summaries by specifying exactly how you want the information presented.

           

          If that idea is of interest to you post back once you have satisfactorily extracted the fields you need and have had a look at Summaries  - it will be more meaningful at that point than it will be now and I don't want to make the whole simple process look like it is complex and confusing.

           

          HTH.

           

           

          Grant

            • Create 2 Models with Multiple lines
              YANECKC _

              Grant , your advise about going thru the Learning Guide and the information

              you gave me about creating Model1 and 2 worked out perfect !

               

              Now I am going to try to create a template using SUMMARIES.

               

              I have now only being working with Monarch for about two weeks and

              it is a great tool.

               

              Thank you for your help.

               

              Yaneckc

                • Create 2 Models with Multiple lines
                  Grant Perkins

                  Yaneckc,

                   

                  I'm really pleased this worked out for you. Moving on to the summary idea should also prove to be a useful and enlightening learning activity - be sure to read any relevant Learning Guide chapters! I found that once I reached Chapter 5 or so and then on through to 10 I understood so much more easily having done the groundwork with the early chapters. (The Chapter numbers numbers may vary a little - I was working with versions 3 and 4 back then  - but I think the basic principle is the same.

                   

                  With the later chapters I found that by then I had picked up enough comfort level to be able to use just the relevant sections of the Chapter that seemed to fit what I was trying to do. Over time that covered the entire set of chapters but working with them as a practical guide it was easier to check for all possible useful sections and then just work with those

                   

                  It is possible to do much more than can be covered in the Learning Guide  - but that is what the Forum (and the Conference materials for those lucky enough to go ) can help to fill in.

                   

                  I totally agree with you about Monarch being a great tool. There are only 2 software applications that I really enjoy using and Monarch is one of them.

                   

                  Have fun.

                   

                   

                  Grant