I just checked and their RSS url no longer works.
Sat Oct 02, 2021 1:24am

I figured maybe it still would because there's the one active forum left but the goes to a page not found now. That was a good idea though.

Trailing spaces exist by default in COBOL on alphabetic or alphanumeric fields as they're fixed length. So any unused character positions are filled with spaces at initialization (more or less).

Example field below a "pic x(20)" which is an alphanumeric field of 20 bytes with one byte per character. Dashes represent the field length, "+" represent spaces. "|" are just to show field boundaries.

move "Hello world" to variable

move " Hello world" to variable

Then if I "remove the leading spaces", there are still spaces at the end.

This can be sort of annoying when printing stuff to the screen. Like if you have a name field that's 15 characters long, but the person's name is only 4, it will still print 15 characters.

So, if I was to print "Erik" in a sentence, it would come out like:

Hi Erik ! How are you?

Thankfully there's an intrinsic "trim" function that can be used so that it displays as expected.

Actually, I'm not sure why I'm just not using that instead.

...and I'm rambling again :)

Edit: I just tried using the built in "trim" function instead and it worked as expected... well that code was a waste of time. lol. Created ticket to fix it:

Edit 2 2021-10-07: Never mind, mine actually ended up working better in a test feed I tried. Looks like the built-in trim function only deals with spaces where I have mine set up to replace spaces and tabs. Some feed files are tabbed instead so the built in function didn't clear out the blank space on those. Changes reverted back.

  • Click here to receive daily updates
    "Forces act when not restrained" - Puckdropper