How can I check status of a file during debug?

170 pts.
Tags:
AS 400
RPGLE
How would I be able to check the status of a file during debugging in AS/400? It's status: open/close.

Software/Hardware used:
System level . . . . . . . . . . . . : V7R3M0

Answer Wiki

Thanks. We'll let you know when a new response is added.

Unless your files are user controlled in the program they will open when debug is started. If you are looking to find the status of a file not being used by the program you are debugging that is a bit more difficult. More details will help us provide a better answer.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • GregManzo
    Your question is a bit open-ended, I'm assuming you are stopped at a breakpoint in interactive debug. 
    If you have an INFDS for the file in question you could examine that (from memory the open/close flag is the 9th byte), or failing that try doing a WRKJOB and looking at what files you have open. You may need to be aware of what other programs in the stack will have files open also.
    My personal preference is to code: 
    If not %open(file); Open file; Endif;
    That way I never need care about it - if the file needs opening it will get opened. Move on to bigger & better problems.
    2,515 pointsBadges:
    report
  • Subhendu Sen
    You can use %STATUS a built in function to get information on exception. While it returns the most recent value set for the program/file status.
    105,870 pointsBadges:
    report
  • ToddN2000
    You could try SYS REQ (Shift+ESC) then 3 and then select option 13 to show the open files if active.
    102,460 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: