writing to a flat file/stream file

1,150 pts.
Tags:
CL programming
Flat files
IBM i
Stream files
V6R1
can we write to a flat file/stream file or both, a variable value using CL program?

Software/Hardware used:
IBM i,V6R1
ASKED: May 11, 2010  2:44 PM
UPDATED: May 11, 2010  8:23 PM

Answer Wiki

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

Sure, but why would you want to?

I/O for stream files/flat files in the IFS is done using APIs, which are much easier to deal with in a language like RPG or COBOL. Use the right tool for the job.

============================================================

As of V5R4, ILE CL handles streamfile I/O almost the same as ILE RPG, C or COBOL. It’s probably much easier to write in CL, but the APIs will be the same ones. Use the open(), write() and close() APIs. These are listed and described in the <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/unix2.htm”>Integrated File System APIs</a> topic.

Although these can be easier in ILE CL than other languages, it should probably be done for proofs-of-concept or prototyping or learning, rather than for significant production programming. ILE CL can only include a single procedure in each source module. For some purposes, that is okay for CL.

Tom

Discuss This Question:  

 
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

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