Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Parse structured rule truncates spaces



Parse structured rule truncates spaces.

Error Messages

Not Applicable

Steps to Reproduce

Use Parse-Char-Pos as part of a structured parse rule.

Root Cause

An issue in the custom application code or rules

Parse-Char-Pos is working as expected. 
The Parse-Char-Pos method takes two arguments offset and length.
Spaces are preserved, though in the simulator and clipboard dis[play it may appear otherwise.


Specify an offsett of 0 to continue from where the last property was parsed (or the begining of the line) and a length for the specific length, in characters, for the size of the next fixed lenghth item.
If using Parse-Char_Pos to parse a line at a time in a file, then the end of line character or characters must be parsed like any other character in the input stream. This will vary by platform and be either a one or two chacaters for UNIX or Windows.

Here is a screen shot of a Structured Parse Rule that parses a fixed lengthed input record from a file as part of a file listener.

The log message in this example emits the value in the file and the length - confirming that the data is both read and that spaces are preserved.

The output in the log file is this:
ColumnLength5=12345 length is 5
ColumnLength10=1234567890 length is 10
ColumnLength15=123456789012345 length is 15
ColumnLength5=A     length is 5
ColumnLength10=B          length is 10
ColumnLength15=C             E length is 15
ColumnLength5=X     length is 5
ColumnLength10=Y          length is 10
ColumnLength15=Z               length is 15


Published December 22, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us