CL Program: How to read a file

15 pts.
Tags:
AS 400
CL Program
How do I read a file (Employee) and get the Emp No. from that?
1

Answer Wiki

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

This should be a very simple RPGLE program. Unless you need to override a file or library there is really no need for a CL. Without specifics like file names there is little guidance we can provide. Also thing like is the file keyed, how is it to be read input primary (no key) or read by key. What are you doing with the data once read. Try it and post your code with any errors and we can help you fix your issues.. You will learn by doing, not if we write the code for you.

Discuss This Question: 2  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
    For CL, you declare the file with DCLF, read records (or rows) with RCVF in a loop until end-of-file. Each time a record is successfully read, the CL simply references the automatically declared variable that holds the "Emp No.".
    35,730 pointsBadges:
    report
  • PoojaSingh
    Thanks TheRealRaven.. :)
    15 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: