Read IFS file in RPGLE Working with IFS file has always been one of the important things while programming with RPGLE. The most common way to deal with IFS file is Copy the IFS file to Flat file using CPYFRMIMPF/CPYFRMSTMF. Read the Flat file in RPGLE. Or Write the Data into File in RPGLE. Copy the File to IFS by using CPYTOIMPF/CPYTOSTMF. This involves writing additional CL Program or using QCMDEXC API to execute CL Command to copy the data from/to IFS and Creation of Temporary/Permanent Database file. Accessing IFS files has become easy by using 'open', 'close', 'read' and 'write' functions. Below is an Simple Example on how to Read data from IFS and write into Database file. **Free Ctl-Opt DftActGrp(*No) ; // ProtoType Declaration for 'open' Dcl-PR OpenIfs Int(10) ExtProc('open') ; pIfsPath Pointer Value Options(*String) ; pFileStatusFlag Int(10) Value ; pFilePermission Uns(10) Value Options(*NoPa
Code with PR - Technical tips on coding and more...