Solved

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

Posted on 2004-10-14
9
1,651 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A procedure for exporting installed hotfix details of remote computers using powershell
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now