Problem solve Get help with specific problems with your technologies, process and projects.

Data manipulation with varying keyword

I was recently presented with the age-old problem of data manipulation involving character and numeric data. In particular, I needed to take a 6-char field containing left-justified, blank-filled numeric data and move it to a 5-char field as right-justified, zero-filled. The standard examples that I saw all used loops to process data structures through array manipulation. However, RPGIV's varying-length datatype makes for a simple, short solution. The size of the varying-length string changes as the amount of characters that occupy the string changes.


I was recently presented with the age-old problem of data manipulation involving character and numeric data. In particular, I needed to take a 6-char field containing left-justified, blank-filled numeric data and move it to a 5-char field as right-justified, zero-filled. The standard examples that I saw all used loops to process data structures through array manipulation. However, RPGIV's varying-length datatype makes for a simple, short solution. The size of the varying-length string changes as the amount of characters that occupy the string changes.

Dig Deeper on RPG iSeries programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close