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



Dear all,
   
  I have a procedure accepting an *VARSIZE parameter.
  On return other variables ar overwritten and as result, crashing the program.
  The Procedure is defined as follow:
  D P_AMTCHR        PR             1a                      
D   AMTNUM                      14  0                    
D   AMTCHR                      19A   OPTIONS(*VARSIZE)  
D   AMTLNG                      10i 0 VALUE              
D   AMTSGN                       1A   CONST              
D   AMTCCY                       3A   OPTIONS(*NOPASS)
   
  The execution is as follow:
  C                   EVAL      P_OK=P_AMTCHR(BITCHRSTP:
C                             SFLD6:%LEN(SFLD6):'-')  
C                   EVAL      P_OK=P_AMTCHR(BITCHRIBN:
C                             SFLD7:%LEN(SFLD7):'-')  
   
  Variable SFLD7 is in this example 12 positions (but could be any).
  The value in SFLD7 on return is correct.
  Variables defined after SFLD7 are altered.
   
  Here the specific part of the dump:
  SFLD7                 CHAR(12)             '       4.00-'             
                      VALUE IN HEX         '40404040404040F44BF0F060'X
SFLMAX                PACKED(2,0)          04.              '4040'X   
SSTAT                 CHAR(11)             '   ered    '
   
  Or better said, the procedures just returns 19 positions overwritting 7 
positions in other variables.
  I can understand what is happening (although I do not want to understand it).
  Is this intended to happen?
   
  Regards,
  Eduard Sluis.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.