Build JSON Composition Code (BLDCMP)

The BLDCMP command is used to assist with generating RPG code for composing JSON documents using the RXS JSON composition subprocedures. When provided with a sample JSON file in the IFS, BLDCMP can generate compilation-ready RPG source that will output that JSON in full using the RXS JSON composition subprocedures. It can generate in either mixed-format (fixed D-specs) or free-format (column limited) RPG, and can output to either a source member or a file in the IFS. Once generated, this code can either be used as the foundation for your program or copied into an existing program.

Note: You will need to replace all of the content values in the composition subprocedures with appropriate source inputs, since these are populated with the values from the input document. You will also likely want to make manual modifications to the generated code to handle conditions where objects or fields are repeating, ie. arrays. The generated code does not include any data handling logic.

Parameters

JSON Input Stream File (SRCSTMF)

This is a required parameter.

Provide the fully-qualified file path to your sample JSON document in the IFS.

Possible Values:

character-value
IFS path to JSON file that will be read to generate the RPG composition code.

Output Source File (OUTFILE)

This is a required parameter when the generated code is to be written to a source member.

Specify the source physical file (and optionally the library) for the output source member.

Possible Values:

character-value
Physical file name in which the source member exists, or will be created.

Output Member Name (OUTMBR)

This is a required parameter when the generated code is to be written to a source member.

Specify the name of the source member to which the generated code will be written. This source member will be created if it does not already exist.

Possible Values:

character-value
Source member that either exists or will be created.

Output Stream File (OUTSTMF)

This is a required parameter when the generated code is to be written to a stream file in the IFS.

Specify the fully-qualified file path to the output stream file in the IFS.

Possible Values:

character-value
IFS path to the file where the parsing handler code will be written.

Append Output (APPENDOUT)

This is a required parameter.

Specify whether the generated code should be appended to the existing contents of the output source member or file, or if the existing content should be overwritten.

Possible Values:

*YES
Append generated code to existing content. This is the default value.
*NO
Existing content will be overwritten.

Code Format (CODEFORMAT)

This is a required parameter.

Specify whether the generated code should be mixed- or free-format RPG.

Possible Values:

*FREE
Generate free-format code. This is the default value.
*MIXED
Generate mixed-format code.