[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2437
  • Last Modified:

RPGLE. how to set the file pointer back to the top on a physical file

i'm looping through a physical file with a read operation.  after reading through the physical file once, i would like to set the file pointer back to the top and read through the file again.  How can I do this without closing and opening the file again?  the physical file has no keys.
0
roosterup
Asked:
roosterup
  • 2
  • 2
  • 2
  • +2
1 Solution
 
daveslaterCommented:
Hi
you can decalre a numeric field 10,0. Set it to 1 then chain in as you would with a keyed file

This will reposition a record 1

Dave
0
 
roosterupAuthor Commented:
I just want to reset the file pointer as if the file had just been opened.
0
 
daveslaterCommented:
Hi
That is the only way I know. I would wait and see if anyone else has some other ideas.

Dave
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
roosterupAuthor Commented:
i know closing and reopening the file would work, but i don't want to do that.
0
 
MurpheyCommented:
Hi Roosterup,

Did you tried a SETLL ???

For indexed files :
     *LOVAL     SETLL      MyFile

For non indexed files:
      0       SETLL     MyFile

Never tested this, but the compiler thinks it's OK, so give it a try

Regards,
Murph
0
 
tliottaCommented:
roosterup:

With no keys, you're reading in Arrival sequence. The SETLL with *LOVAL as factor 1 should give you what you want.

Tom
0
 
HelixirCommented:
Try something like

*START      SETLL       MyFile

I'm not sure if works !!
0
 
HelixirCommented:
I did some test yesterday and *START on a physical file works !!
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now