× 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.




I've never declare a parameter with both varying and options(*varsize)
keywords.  What is the purpose/benefit of declaring parameter that a
way.
    d                               40a   Varying Options(*VarSize)

I strongly disagree with you.

What's the benefit? When you're writing a program or procedure that is to be called from many different programs, you should design your procedure to be as easy to call as possible. If you have to do extra work to convert data, you should do it in the procedure -- after all, you're going to write the subprocedure ONCE and you're going to call it MANY TIMES. Why make every caller do variable conversions before calling your program?!

Let's say I've written a procedure that translates EBCDIC to UTF-8. It's used by 10 programs on my system. One program wants to translate addresses, and stores those addresses in 3 fields, each 35A VARYING. Why should that program have to convert it to 40A VARYING to call my subprocedure? Wouldn't it be nice if the subprocedure could handle different sizes besides 40A VARYING?

At the same time, a second program has a line of text that's 80A VARYING. Now it has to split it into 2 fields, each 40A VARYING and call the subprocedure twice.

Another program has a 1A VARYING field that it wants to convert. Now it has to move that 1A VARYING to a 40A VARYING, call my procedure, then convert it back.

If I had used OPTIONS(*VARSIZE) I could've allowed any size field to be passed. One subprocedure that's usable from anywhere.

So why do you object to that?

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.