How to write Data to Variable File using RPG ?
Page 1 of 1
How to write Data to Variable File using RPG ?
We can use C routines to achive this.
Unlike the RPG opcodes, however, the C routines are all implemented as subprocedures, and don't need to know the name of the file or its layout at compile time. One advantage to that is that you can make it work with any file with no code changes. The disadvantage is that they're ever-so-slightly slower than RPG's opcodes.
The following C routines you can call in the RPG program to do the same.
_Ropen: opens a record-oriented file
_Rwrite: writes a record to a record-oriented file
_Rclose: close a record-oriented file
Unlike the RPG opcodes, however, the C routines are all implemented as subprocedures, and don't need to know the name of the file or its layout at compile time. One advantage to that is that you can make it work with any file with no code changes. The disadvantage is that they're ever-so-slightly slower than RPG's opcodes.
The following C routines you can call in the RPG program to do the same.
_Ropen: opens a record-oriented file
_Rwrite: writes a record to a record-oriented file
_Rclose: close a record-oriented file
Similar topics
» NO opcodes but perform Write and Update operation on the file.
» Restoring Spooled File Data After a System Restore
» Write, Update & Delete the records via RPG without recspective opcodes WRITE, UPDAT & DELET
» What are the reasons a logical file may be "dropped" during the File definition load process?
» Define term 'File Type' and list various file types.
» Restoring Spooled File Data After a System Restore
» Write, Update & Delete the records via RPG without recspective opcodes WRITE, UPDAT & DELET
» What are the reasons a logical file may be "dropped" during the File definition load process?
» Define term 'File Type' and list various file types.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum