ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

%Bof Condition or something like

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

  • %Bof Condition or something like

    Hy guys i have finally resolved all my problems and issues with the subFIle. So hard to learn ... Now i have a cool question. I see that exist an %Eof condition that return always me '1' if my RPG is on the End Of File. Now my question is, does exist another switch like %Eof that tell me i'm at Bof?

    I need this because when i read a file for charge the subfile data, i manage also the rollDown(PageUp) with a ReadPE. I need to know when i'm at Bof or Eof. For my RPG is different.
    The consistency of the code is directly proporzional them to the knowledge

  • #2
    Re: %Bof Condition or something like

    %EOF will suffice for both the EOF and BOF conditions. It all depends on the direction of the read.

    If you are doing a READ (or READE) and run out of records (i.e. at the End of File) then %EOF will be set on.

    If you are doing a READP (or READPE) and run out of records (i.e. at Beginning of File) then %EOF is set on.

    So....when reading forwards %EOF tells you that you have reached the End of File, and if reading backwards %EOF tells you when you have reached the beginning of the file.

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

    Comment


    • #3
      Re: %Bof Condition or something like

      O well now i know why sometimes it tell me End Of but i'm at the beginning (i think)
      The consistency of the code is directly proporzional them to the knowledge

      Comment


      • #4
        Re: %Bof Condition or something like

        There are two ends of any file. The top and the bottom. The %EOF is telling you that you are at one end or the other.

        Welcome to the Forums.
        Never trust a dog to watch your food.

        Comment


        • #5
          Re: %Bof Condition or something like

          Ok but i need to make distinction for End and Begin ... Is there something to know this? I explain, when i make a pagedown on my manually subfile if i'm at the of my Eof turn on but also when i'm at the begin ... I need to make a distinction ...
          The consistency of the code is directly proporzional them to the knowledge

          Comment


          • #6
            Re: %Bof Condition or something like

            if you have more than 1 record in the file then rrn=1 BOF anything greater than rrn>1 = EOF

            use INFDS to get RRN
            D DB_RRN 397 400I 0 * Relative-rcd-num

            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


            • #7
              Re: %Bof Condition or something like

              thanks a lot. Maybe you know i need to include a select statment in my rpgle and work with single records thet it returns me, have you some goog link page?
              The consistency of the code is directly proporzional them to the knowledge

              Comment

              Working...
              X