Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-10-14
9
Medium Priority
?
2,181 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
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 200 total points
ID: 12346617
I did some test yesterday and *START on a physical file works !!
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

721 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