Skip to content

ProfoundLogic/profound-utils

Repository files navigation

Profound Utils

A collection of Profound Utils, to help simplify tasks in various Profound products.

Table of Contents

Getting Started

These instructions will get you a copy of the project up and running on your machine.

Prerequisites

You will need to have Node.js installed in order to run these utilities.

Installing Profound Utils

Decide where you want to install these utils. Maybe your Home folder?

$ cd ~

Now you just need to clone this repository from Github

$ git clone [email protected]:ProfoundLogic/profound-utils.git

Then you can change your current folder into this folder

$ cd profound-utils

Finally, install all of the project dependencies from npm

$ npm i

Listing the Utils

You can issue the following command to get a list of Utility commands currently available. Please see each section of this README for a detailed description on each utility.

$ node .

Getting Help

You can type the following on each utility to get additional help information

$ node <utility-name> --help

or

$ node <utility-name> ?

Utils

DDS/JSON Conversion Verifier

This utility will check for any unexpected DDS issues, by running two consecutive conversions to verify the DDS conversion logic. It will take parameters for the initial DDS input, then run the DDS->JSON converter, and then the JSON->DDS converter. It then compares the new DDS source back to the original DDS source, and reports any discrepancies.

Syntax

$ node verifyConvert input-DDS-file [input-library] [input-member]

Parameter Descriptions

input-DDS-file
    This is the Input DDS source to verify. It can be a Source Physical File (e.g. QDDSSRC), or a path-based file name.

[input-library]
    (Optional). If input-DDS-file is a Source Physical File, then this is required, and specifies the Library containing the Source Physical File.

[input-member]
    (Optional). If input-DDS-file is a Source Physical File, then this is required, and specifies the Member Name that contains the DDS data for conversion. 

DDS to JSON display-file converter

This utility will convert an existing DDS source-based Display File into JSON format. This will allow you to realize many advantages over the DDS version, such as performing mass Find/Replace changes in your favorite Source editor, moving the screen to a Git repository for change control, etc.

Syntax

$ node ddsToJson output-directory input-DDS-file [input-library] [input-member]

Parameter Descriptions

output-directory
    The Output Directory where the converted JSON file will be created. This Output Directory must exist and have write permissions. The converted file will be named as LIBRARY.FILE.MEMBER.json

input-DDS-file
    This is the Input DDS file that contains the DDS data you want to convert.
    It can be a Source Physical File (e.g. QDDSSRC), or a path-based file name.

[input-library]
    (Optional). If input-DDS-file is a Source Physical File, then this is required, and specifies the Library containing the Source Physical File.

[input-member]
    (Optional). If input-DDS-file is a Source Physical File, then this is required, and specifies the Member Name that contains the DDS data for conversion. 

JSON to DDS Rich Display File converter

This utility will convert an existing JSON-based Rich Display File into DDS format. This will allow you to convert JSON files back into native DDS format, ready for compile and/or testing.

This conversion will take ALL the existing DDS source lines from the OLD DDS Source File/Member, but will insert the changed JSON sections from the NEW source file, and insert them into the HTML tags. This eliminates any risks from parsing the NEW file, but means that you cannot do the following:

  1. Add or Remove any Record Formats in the new source file.
  2. Add or remove any Bound fields in the new source file.

Syntax

$ node jsonToDds input-JSON-file output-DDS-file output-library output-member original-DDS-file original-library original-member

Parameter Descriptions

input-JSON-file
    This is the Input JSON file to be converted into DDS format.

output-DDS-file
    This is the Output file name. It can be a Source Physical File, or a path-based file name. If this is a Source Physical File, it must exist.

[output-library]
    (Optional). If output-DDS-file is a Source Physical File, then this is required, and specifies the Library containing the Source Physical File. The Library must exist.

[output-member]
    (Optional). If output-DDS-file is a Source Physical File, then this is required, and specifies the Member Name that will be created to contain the converted DDS data. The Member must NOT exist, to prevent accidentally overwriting existing data.

Recommended Setup for Mass-Conversions

Maybe you have a lot of DDS Source members you want to convert? You could add a PDM User-Defined Option to assist with converting multiple/all members in a DDS Source file.

The syntax for this is as follows

Option  . . . . . . . . .   DJ   Option to create
Command . . . . . . . . .   qsh CMD('node /path/to/utils/repo/profound-utils/ddsToJson.js /absolute/path/to/output-directory-name &F &L &N')

In order for this to run correctly, your current job must have the following Environment Variable set to Allow Multiple Threads

Name  . . . . . . . . . :   QIBM_MULTI_THREADED
Value . . . . . . . . . :   'Y'

You may want to prevent Interactive Shell Command Output from interrupting each request

Name  . . . . . . . . . :   QIBM_QSH_CMD_OUTPUT
Value . . . . . . . . . :   'NONE'

Issues

Any issues or feature requests should be logged here.

Built With

  • Standard - JavaScript Standard Style
  • idb-pconnector - Promise-based DB2 Connector for IBM i
  • pino - Node.js logger, inspired by Bunyan

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

You must purchase a Profound UI or a Profound.js license to use this repository.

Acknowledgements

About

Collection of Profound Utils

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •