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.

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

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: 6  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
  • WoodEngineer
    Bruce, I would be very interested to see your solution where you wrote "CL included".
    6,945 pointsBadges:
    report
  • Splat
    Have you looked at CPYFRMIMPF?
    8,175 pointsBadges:
    report
  • bvining
    Hmm, I have to suspect that "something" was lost when this 2008 entry got updated. I usually provide at least a link to the solution and the response from the original poster "Bruce's solution was too good. It is a different world and I need some practice. I didn't know we can read IFS files from CL directly" certainly suggests "something" additional was provided.

    In any case, ILE CL (just like ILE RPG) can call the various IFS APIs documented here. If you have access to COMMON handouts you'll find a CL example of writing and reading from an IFS *STMF in the appendix of APIs at Work. Though I'm thinking right now that a series of articles in MC Press CL Corner (implementing commands such as Open Stream File, Read from Stream File, Write to Stream File, and Close Stream File) might also be rather handy for CL developers :) Thoughts?

    Bruce Vining
    6,870 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:

Share this item with your network:

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