× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Simon Coulter wrote:

MOVE X to Y WITH SPACE PADDING would be nice. SPACE could be any character.

Given the added bit -- "SPACE could be any character" -- that makes useful sense to me. Yet, the noted issue was with the STRING verb. COBOL MOVE already performs padding with SPACE when appropriate. STRING, however, seems pretty explicit in how it doesn't pad.

With the original example:

STRING var2 DELIMITED BY SIZE,
"somestring" DELIMITED BY SIZE
INTO var1.

...I wouldn't be using STRING anyway. I'd have VAR1 be a group-item with two elementary items, and I'd use MOVEs for those elementary items. Data definitions can help determine what instructions to use. There wouldn't be the same padding issue in that case.

However, having an option for STRING [WITH SPACE PADDING] to pad also could make for a minor code improvement. I'm not sure it's that much better than [MOVE SPACES TO var1] though.

I suppose I should add (for the RPG list) that EVAL has an advantage because %trim() can be a source and the target can be a varying-length variable -- advantage RPG. Is there any way EVAL can operate _without_ pad on a fixed-length target?

Tom Liotta


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.