ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Reposition file with no key

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

  • Reposition file with no key

    I want to read a file twice that doesn't have any keys in an RPG program (not ILE). After reading all the records in the file once to the end of the file (so that I can hold information in certain arrays) I can't find a way of repositioning it back to the top so that I can read it again. SETLL doesn't work on files without a key. Any ideas how this can be done?

  • #2
    Re: Reposition file with no key

    Sure.

    Chain 1 MyFile.
    Read MyFile
    .....


    The 1 is the relative record number in the file. So you just went back to the top of the file.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: Reposition file with no key

      How about the opcodes open and close?
      Just use the keyword usropn on the f spec.

      Best of Luck
      GLS
      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

      Comment


      • #4
        Re: Reposition file with no key

        There is a post by that remarkable woman of Coding (Birgitta) that might be of some help here.

        See this: http://www.code400.com/forum/showpos...74&postcount=2

        It might give you some alternatives as well...

        -Rick

        Comment


        • #5
          Re: Reposition file with no key

          better yet

          setll *loval myfile
          read myfile
          Philippe

          Comment

          Working...
          X