Solved

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

Posted on 2004-10-14
9
1,905 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
Deploying our service is a grudge match between customer benefits and customer pain. In one corner, rolling out fixes (yay!) and delivering new features (double yay!). In the other corner, training on new features (boo – sounds like work), and chan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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