On 24/06/2008, at 1:56 AM, Aaron Bartell wrote:

I am doing a little COBOL these days and there are a handful of small things
that drive me nuts that I take for granted in RPG.

For example, I have to first clear a string variable before I apply a
literal value to it in the event the last string was longer than the one I
am putting in. I would love to hear I am doing something wrong and there is
an easier way :-)

You used to have to do that in RPG too, remember. Then we got MOVE(P) and later EVAL. Investigate USAGE IS NATIONAL for your character data types. A MOVE into a NATIONAL data type is supposed to be padded with the character specified on the NTLPADCHAR option of the PROCESS directive. Of course, this means using UCS-2 data in your program which may not be what you want.

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


MOVE SPACES TO var1.
STRING var2 DELIMITED BY SIZE,
"somestring" DELIMITED BY SIZE
INTO var1.
CALL PROCEDURE "RPG_CODE" USING
var1 RETURNING isError.

That makes for a lot of extra coding in my COBOL program that I don't have
in RPG.

I would love it if I could instead do the following:

CALL PROCEDURE "RPG_CODE" USING trimr(var2) + var1 RETURNING isError.

That's not quite the same as your STRING code is doing.

From the COBOL Language Reference:

o Each USING identifier must be defined as a level-01 or level-77 item in the
Linkage Section of the called subprogram

so I think you'll never see what you want in COBOL without some major changes to the language.r

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.