Reading IFS file from CL program

60 pts.
Tags:
CL
CL programming
CPYF
CPYFRMSTMF
IFS
I have a requirement of reading a IFS file from CL program. As far as I know there is no direct way of achieving this. I am planning ot use CPYFRMSTMF followed by CPYF to copy the IFS file first as a memeber and then as a database file. Is there any better way to achieve this? Regards Sudip

Answer Wiki

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

Hi,

You shouldn’t need to do a CPYF as well as the CPYFRMSTMF. The CPYFRMSTMF should be enough. Depending on what you need to do in your CL program, QSHELL may offer an alternative for you.

Regards,

Martin Gilbert.

———————————————————————————————-

At the very end of <a href=”http://www.brucevining.com/Presentations/PPT_Presentations/How_to_Use_the_Most_Common_APIs.pdf”>this presentation</a> are two sample CL programs. The first writes data to an IFS text file, the second then reads the data. The “rules” of using the IFS directly can be found earlier in the presentation where the RPG example is given. You do not need to copy the IFS file to a database file in order to access the data from any of the high level languages (CL included).

Regards,
Bruce VIning

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • mcl
    The CPYFRMSTMF will do the job.. FROMSTMF parameter (the IFS address) - "DIRECTORY/FILE.EXT" TOMBR parameter - "/QSYS.LIB/mylib.LIB/myfile.FILE/mymember.MBR" Substiture the proper values for "mylib", "myfile", and "mymember" and also for your IFS values for "directory" and "file.ext" If you need to manipulate the IFS files (remove, rename, copy all within the IFS) you'll need to use unix commands through QSHELL. Regards Mike
    2,740 pointsBadges:
    report
  • Gilly400
    Hi, You can also use the commands RNM, CPY & MOV to work with files in the IFS (without using QSHELL). Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Raju400
    Thanks Martin, Bruce and Mike. Aplogies for the late reply. The CPYFRMSTMF followed by OVRDBF worked. Bruce's solution was too good. It is a different world and I need some preactice. I didn't know we can read IFS files from CL directly. Many thanks Sudip
    60 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following