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.
LVL 1
roosterupAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
HelixirConnect With a Mentor Commented:
I did some test yesterday and *START on a physical file works !!
0
 
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
daveslaterCommented:
Hi
That is the only way I know. I would wait and see if anyone else has some other ideas.

Dave
0
 
roosterupAuthor Commented:
i know closing and reopening the file would work, but i don't want to do that.
0
 
MurpheyApplication ConsultantCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.