Parses a copybook for which the path is set in either the constructor or updateCopybookPath(path)
and returns an array of DataItem's representing the copybook
Array of DataItem representing the copybook
CRLF or LF*If the copybook contains an OCCURS clause, the processed dataItem will be replaced by n dataItems. They will be identified by the DataItem.name property
like NAME-n
Convert the parsed copybook to a JSON string
string JSON object representing the copybook as string
Return value will be an empty JSON array if the parse() function has not yet been executed
CopybookParser lets you parse a COBOL copybook into an array of DataItem's that can be then be used further.
Together with the Transaction and TransactionPackage class, it can be used to load transaction data from a file, parse it into DataItem objects, alter the value and store the (modified) transaction
Example
Parse a copybook: