Solved

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

Posted on 2004-10-14
9
1,855 Views
Last Modified: 2008-02-01
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
Comment
Question by:roosterup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 14

Expert Comment

by:daveslater
ID: 12310534
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
 
LVL 1

Author Comment

by:roosterup
ID: 12310556
I just want to reset the file pointer as if the file had just been opened.
0
 
LVL 14

Expert Comment

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

Dave
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:roosterup
ID: 12310660
i know closing and reopening the file would work, but i don't want to do that.
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 12317043
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
 
LVL 27

Expert Comment

by:tliotta
ID: 12322268
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
 
LVL 1

Expert Comment

by:Helixir
ID: 12337784
Try something like

*START      SETLL       MyFile

I'm not sure if works !!
0
 
LVL 1

Accepted Solution

by:
Helixir earned 50 total points
ID: 12346617
I did some test yesterday and *START on a physical file works !!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

While it may be true that the internet is a place of possibilities, it is also a hostile environment lurking with many dangers. By clicking on the wrong link, trusting the wrong person or using a weak password, you are virtually inviting hackers to …
Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question