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



Ok, I use Code/400.  It has a wonderful wizard to do many things.  One is
to create a subprocedure.  This wizard follows the form that you store your
results into a variable and use one return statement.  (I don't want to
clutter this thread as to the merit of this logic, please.)  The variable
they always use is retField.  I've defined a multitude of subprocedures
with this pattern.  And the size of retField changes based on what I am
returning.  No big deal, they're local variables in subprocedures.
I was getting the error message:
Record  *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...
+... 7 ...+... 8   SEQNBR  Last change
                            010893020225            10893   02/25/02
173        C/end-exec
ct tptfile into :retField
010914020225            10914   02/25/02
...
MSG ID  SEV  RECORD  TEXT
SQL0312  30     193  Position 30 Variable RETFIELD not defined or not
usable.

So I renamed the retField in the first subprocedure to retFieldX.  The
error message dropped down to the next subprocedure.

Sample subprocedure:
     P*--------------------------------------
     P* Procedure name: GetTPTLIB
     P* Purpose:
     P* Returns:        Library name or *NONE
     P* Parameter:      tptType => Trading partner type
     P*--------------------------------------
     P GetTPTLIB       B                   EXPORT
     D GetTPTLIB       PI            10A
     D tptType                             LIKE(TPTYPE.TPTTYPE) CONST

     D* Local fields
     D retFieldX       S             10A   inz(*loval)

     C/exec sql
     C+ Select tptlib into :retFieldX
     C+ from eis/tptype
     C+ where tpttype=:tptType
     C/end-exec
      /free
       return retFieldX;
      /end-free
     P GetTPTLIB       E

pmr 78018,500

Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.