Listing IFS files in AS400

565 pts.
Tags:
#AS400 #RPGLE #CL
I have a RPGLE program where i plan to list the IFS files present in a directory (as a display file). 

I call CL from RPGLE. In CL program, I perform override as below -

OVRDBF     FILE(STDOUT) TOFILE(LIBRARY/FILE) OVRSCOPE(*CALLLVL) SHARE(*YES)      

Then, I execute corresponding Linux (LS) commands to fetch the IFS files into the given file name.

My doubt is, this doesn't work when I specify library name other than qtemp in OVRDBF. It works only if i specify Qtemp in OVRDBF command. Why is that? If I have to use Qtemp only, how will I read the file back in my RPGLE program?
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 5  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.
  • TheRealRaven
    What is meant by "this doesn't work"? Is there an error? What error? If not, what happens? And why would QTEMP cause any problem in RPGLE?
    36,320 pointsBadges:
    report
  • ToddN2000
    Is this process running as an interactive job or batch job?  If interactive yo should not have an issues using QTEMP. If running in batch, you could always do a CPFY from the QTEMP library  to a production library for later use after the job ends. If it fails when using another library post the error message so we know exactly what is going on.

    135,305 pointsBadges:
    report
  • sri8707
    Hi TheRealRaven and ToddN2000, thanks for your replies. I changed my process to use development library instead of Qtemp and it looks fine at the moment. 

    Here is my problem.

    In CL program, i perform
    ovrdbf file(stdout) tofile(library/file1) ovrscope(*calllvl) share(*yes)
    qsh cmd('ls -l *.* ')
    dltovr file(stdout) lvl(*)

    When i complete above CL code and return back to RPGLE, I try to read contents from file1. But, i dont find the values there. (No errors, just the file looks empty). Am i missing anything basic here?
    565 pointsBadges:
    report
  • ToddN2000
    Here is a link covering the topic. Check it out and see if you find a mistake in your logic. If not and you still have issues we can try and further assist you. 

    135,305 pointsBadges:
    report
  • sri8707
    Thanks ToddN2000, much appreciate your help. When i moved the fields from file to screen, I could see them. For some reason, i couldnt perform EVAL on the fields in debug mode. 

    Anyway, the issue is fixed. Thanks again
    565 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: