RPG Next Gen
Wiki RSS Feed Weblog
Business picture

Input Providers

This project seperates the data access from the rest of the programs. The actual data access is an implementation of an "interface". Each data access/input provider (f. e. for stream files) is provided as a separate module.

Included is a facade/proxy which can be used with every implementation of an input providers which uses the template data structure provided in the copy book.

RNGIN - Input Provider

The RNGIN module acts a facade/proxy and forwards all calls to the passed implementation. It can also be used to create an input provider instance dynamically via the reflection service program.

RNGINSTMF - Stream File Input Provider

This implementation of an input provider reads a stream file and returns the content line by line. The line ending character(s) can eiter be CR, CRLF or only a LF.

/include 'rng/input_provider_h.rpgle' /include 'rng/streamfile_input_provider_h.rpgle' D input S * D inputPath S 100A D data S 65535A varying D dsp S 50A D i S 10I 0 /free inputPath = '/home/mschmidt/input-test.txt' + x'00'; input = rng_input_stmf_create(%addr(inputPath)); rng_input_open(input); dow (rng_input_read(input : data)); i += 1; dsp = %char(i) + ': ' + data; dsply dsp; enddo; rng_input_close(input); rng_input_finalize(input); *inlr = *on; return; /end-free

RNGINSTMF2 - Stream File Input Provider

This implementation of an input provider reads a stream file and returns the content block by block. One block has a size of 65535 bytes.

Requirements

This software requires the service programs

  • REFLECTION
  • MESSAGE

and the copy books found in the includes.tar file.

The required service programs can also be found in the download section.

License

The software is released under the GNU Lesser General Public License.

Download

The service programs can be found at the download section.