ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Strange Behavior with Chain

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange Behavior with Chain

    I guys i trying to make something strange with Chain or Setll, but it seems to not work. I explain you :

    I have a fisical file called Daily, in this file i can use from 1 to 4 keys.
    The keys are (TOUR, PART, CURR and DDNRP). The data stored is in this format :

    Code:
    [B]TOUR     PART     CURR     DDNRP[/B]
    
    HA         112       14          5
    HA         112       14          10
    HA         112       14          15
    HA         112       14          20
    HA         112       14          25
    HA         112       14          30
    -----------------------------------------
    HB         530       14          5
    HB         530       14          10
    HB         530       14          15
    I need to load this data into a SubFile, but with SflPag = SflSize. I have also implemented the RollUp and RollDown. All work good but ...

    When i make a Chain to
    TOUR = 'HA' PART = 112 CURR = 14 and DDNRP = 15
    i found this record but if i try to continue READ or READE without or with keys i receive %Eof ..

    Wich method can i use to retreive all the record with equal keys TOUR, PART and CURR but only when DDNRP is major then 10, for example?

    I'm spending a lot of days and solutions to resolve this issue, but i'm still trying to find a really workly solution ..
    The consistency of the code is directly proporzional them to the knowledge

  • #2
    Re: Strange Behavior with Chain

    raffaeu

    Try this

    Code:
                  Setll ('HA':112:14:15) Daily;
                  Reade ('HA':112:14) Daily;
    
                  Dow not %eof(Daily);
    
            //  Processing here
    
                    Reade ('HA':112:14) Daily;
    
                 EndDo;

    Mike
    You don't stop playing games because you get old, You get old because you stop playing games!

    Comment


    • #3
      Re: Strange Behavior with Chain

      Dont think reade will work looks like the records are unquie

      PHP Code:

               Setll 
      ('HA':112:14:15Daily;
                    
      Read Daily;

                    
      Dow not %eof(Daily);

              
      //  Processing here

                  
      Read  Daily;
                  
      EndDo
      Also can you post the code for the logial is this logical
      defined with one of the keys descending?????


      thanks
      jamie
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Re: Strange Behavior with Chain

        MikeS's suggestion should work. The ReadE will work as long as only the first 3 fields are specified.

        Comment


        • #5
          Re: Strange Behavior with Chain

          Boy! I am getting old I didnt even notice the dropping of one of the keys.
          Ive been thinking of changing careers --- maybe Jamie "super nurse"
          Or I do like fire engines - too old to carry the hose so maybe I could wax the engine


          I would still like to see DDS of logical.... I have had issues with descending key values and reade.....


          jamie
          All my answers were extracted from the "Big Dummy's Guide to the As400"
          and I take no responsibility for any of them.

          www.code400.com

          Comment


          • #6
            Re: Strange Behavior with Chain

            At least you didn't say Dolphin!

            Comment


            • #7
              Re: Strange Behavior with Chain

              I resolve with this issue. I make the subfile and i record how many records are you reading. Then i make a loop with reape with this number and afteer i make a Chain DoW and compare the record ....
              The consistency of the code is directly proporzional them to the knowledge

              Comment


              • #8
                Re: Strange Behavior with Chain

                But now i have a new question. How i can detect the Bof condition? Does exist something like %Bof like %Eof?
                The consistency of the code is directly proporzional them to the knowledge

                Comment


                • #9
                  Re: Strange Behavior with Chain

                  i conclude with Mikes Solution, is the faster and better!
                  The consistency of the code is directly proporzional them to the knowledge

                  Comment

                  Working...
                  X