writing record to a file through CLLE

5 pts.
Tags:
CLLE
CLLE File Declaration
Physical Files
Can we write a record to the physical file using CLLE?
ASKED: September 8, 2009  11:29 AM
UPDATED: October 11, 2009  7:42 AM

Answer Wiki

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

There is no CL command to allow you do do this.

If you have the record in another file, you can use CPYF and select just that record.
Another option is is use SQL.

—————
here’s a discussion on this topic

http://www.rpgiv.com/rpgivforum/view?SID=20090725140644712051&NRL=18&KW=write%20

Phil

———————–

The recently announced <a href=”http://www.powercl.com/”>PowerCL: CL for Files</a> product has the <a href=”http://www.powercl.com/clf/clfcommands/wrtrcdclf”>Write Record using CLF (WRTRCDCLF)</a> command (and also a <a href=”http://www.powercl.com/clf/clfcommands/write”>WRITE</a> command if you’re familiar with RPG opcodes).

CL for Files provides CL commands for the file operations you historically needed a language such as RPG, COBOL, or C to perform. The commands can be in either an ILE or an OPM CL program.

Bruce Vining
(note that my company markets this product though a simple WRTRCDCLF can be done with the no charge base support of the product)

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

Yes. You can use the CALL command in OPM CL or ILE CL. In ILE CL, you can also use CALLPRC. In both cases, the target will be a HLL program or procedure (or API) that can do the write for you. New commands can be created to replace CALL; they help in formatting the parms and providing [help] text. Most methods provided for giving CL ability to write to database files are such commands. (The extensibility of CL is an important part of its power.)

That is, it is possible to use APIs like _Rwrite() to cause writes to happen. (If you can do what’s needed to make _Rwrite() work effectively in CLLE, you can probably do it in CLE anyway and probably better.) However, other languages can do more database I/O natively than CL.

After all, CL is ‘Control Language’.

OTOH, there are sites that don’t have the common compilers. For those, CL is still always available as is REXX (and MI). REXX might be a little more useful since it supports SQL even when the SQL Development Kit isn’t installed. SQL is somewhat available to CL through the RUNSQLSTM command and the STRQMQRY command. STRQMQRY allows CL to pass parameter values into SQL while RUNSQLSTM can execute static statements.

CL also can pass values into Qshell commands and scripts. One useful Qshell utility is db2 which is another interface to SQL. Other Qshell utilities can also effect file updates through IFS methods.

If database I/O in CL is required, then it can be done. It’s fairly easy to obtain utilities through the internet. The above ‘PowerCL’ is a very good example. You can also create them yourself with some good understanding of CL programming. These utilities can be very handy tools. But be sure that they’re appropriate when other languages are available.

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