× 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'm going to give that a try.

Question:  In your PI (Procedure Interface), you use LIKE(MyDS), but
the data structure below defines MyDS2.  Was that intentional?  Or
would you just as soon use MyDS2?  Does the subprocedure "see" all the
variables in the main module?

TIA, Dan

--- "Haas, Matt" <Matt.Haas@thomsonlearning.com> wrote:
> Dan,
>
> There's two way's to do this, the first is to remove the 'VALUE' from
> Z_ACGAMT and Z_AMTERR which passes the variable by reference instead
> of by value so you can modify it in your subprocedure. Passing by
> value (which is what you do when you add VALUE to a parameter
> definition) is similar to declaring a constant in that you can't
> change it in the subprocedure.
>
> A better way would be to create a data structure for these two values
> and return the data structure just like you would when dealing with
> API's. This makes the program much easier to maintain if you need to
> return another field in the future. To do this, you'd do something
> like this:
>
> DMyDS             DS
> D Z_ACGAMT                       8S 2
> D Z_AMTERR                      30A
>
>
> D CVTA2N          PR                  LIKE(MyDS)
> D   ACGAMT                      10A   VALUE
>
> C               eval     MyDS = CVTA2N(ACGAMT)
>
> P CVTA2N          B
> D CVTA2N          PI                  LIKE(MyDS)
> D   ACGAMT                      10A   VALUE
>
> DMyDS2            DS
> D   X_ACGAMT                     8S 2
> D   X_AMTERR                    30A
> <snip>
> C    .........  EVAL      X_ACGAMT = N_ACGAMT
> C    .........  RETURN    MyDS2
> P                 E
>
> Matt

__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2


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.