× 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 have a problem that is puzzling me.  This procedure has worked for a
long time. And then last week it stopped working.  When I debug it, I
get an error message MCH5003, which is  

Message ID . . . . . . :   MCH5003       Severity . . . . . . . :   40

Message type . . . . . :   Escape

Date sent  . . . . . . :   03/02/04      Time sent  . . . . . . :
15:04:19
 

Message . . . . :   Scalar operand contains a value that is not valid.

Cause . . . . . :   The length of the invalid scalar operand is 4.  The
bit 
  offset to the invalid field is X'0018'. The operand number is 2.  The

  invalid data is X'40404040'.     

I have no idea what this means. Here is the source code for the
procedure

/title TS990630R - Convert Character to Number                    
/copy qrpglesrc,hspecs                                            
*%D***************************************************************
*%D 1. TS990630R: Convert Character to Number                     
*%D                                                               
*%D 2. Description                                                
*%D                                                               
*%D 3. Compile Instructions                                       
*%D                                                               
*%D 4. Procedure                                                  
*%D                                                               
*%D 5. Date       User ID    Description of change                
*%D    ##Date(MDY)##User     Intial Creation                      
*%D                                                               
*%D 6. Indicator Summary                                          
*%D    Ind Alt Name    Desciption                                 
*%D                                                   
*%D 7. Procedure Interface                            
*%D    Name: TS990630R                                
*%D                                                   
*%D     Parameters:                                   
*%D                 Name       Description            
*%D                 ##VarName01##ParmDesc             
*%D                 ##VarName02##ParmDesc             
*%D                                                   
*%D     Gobals:    *None                              
*%D                                                   
*%D     Returns:   *None                              
*%D                                                   
*%D 8. Example                                                      
*%D                  Call      TS990630R  (##VarName01:##VarName02)  
*%D                                                                  
*%D******************************************************************
/EJECT                                                               
HNoMain                                                               
D CvtCharToNum    PR              N                                   
D                               40    Value                           
D                               30  9                                 
 *--------                                                            
 * CvtExtFrmToNum - Convert External Form to Numeric Value            
 *   Receiver variables   Output                                      
 *   Receiver Attributes  Input                                       
 *   Source String        Input                                       
 *   Source String Length Input                                       
 *   Symbol Mast          Input                                       
 *--------                                      
D CvtExtFrmToNum  PR                  ExtProc('_CVTEFN')       
D                                 *   VALUE                    
D                                7    CONST                    
D                                 *   VALUE                    
D                               10U 0 CONST                    
D                                3    CONST                    
 *-----------------------------------------                    
 * Program Status Data Structure                               
D  prgstsdtastr  sds                                           
D  vpgm                   1     10                             
D  verrid                11     15  0                          
D  vstmt                 21     28                             
D  vemsg                 40     46                             
D  vcall                 51     60                             
D  vlib                  81     90                             
D  vemtxt                91    200                             
D  vfile                201    208       
D  vstat                209    243                   
D  vjob                 244    253                   
D  vuser                254    263                   
D  vjobno               264    269                   
 * Redefinitions for file errors                     
D  vfstat                 1     35                   
D  vferr                  1      5                   
D  vfstmt                18     25                   
 *------                                             
 * CvtCharToNum - Convert Character to Numeric       
 *------                                             
PCvtCharToNum     B                   Export         
D                                                    
D                 PI              N                  
D String                        40    Value          
D Number                        30  9                
 *--------                                           
  * Data Definitions                                             
  *--------                                                      
 D RcvAttr         DS                                            
 D  Type                          1    Inz(X'03')                
 D  NbrLen                        5I 0                           
 D   DecPos                       3I 0 Overlay(NbrLen:1)         
 D   TotDigits                    3I 0 Overlay(NbrLen:2)         
                                                                 
 D digits          c                   '0123456789'              
 D                                                               
 D mask            c                   '0123456789$,. '          
 D SymbolMask      DS                                            
 D CurSymbol                      1    Inz('$')                  
 D ComSymbol                      1    Inz(',')                  
 D DecPntSymbol                   1    Inz('.')                  
 D                                                               
  *--------                                                      
* Convert Character  String to Packed Numeric Format         
 *--------                                                    
C                   eval      nbrlen        = *zeros          
C                   Eval      Decpos        = %DecPos(Number) 
C                   Eval      TotDigits     = %Len(Number)    
C                   eval      number        = *zero           
C                   eval      string        = %trim(string)   
C                                                             
C                   if        %check(mask : string) > *zeros  
C                   return    *on                             
C                   endif                                     
C                                                             
C                   CallP     CvtExtFrmToNum(                 
C                                  %Addr(Number)        :     
C                                  RcvAttr              :     
C                                  %Addr(String)        :     
C                                  %Len(%TrimR(String)) :     
C                                  SymbolMask           )        
C                   Return    *Off                               
 *-------                                                        
 * Return Error condition for any error                          
 *-------                                                        
C     *PSSR         BegSr                                        
C                                                                
C                   eval      number        = *zeros             
C                   Return    *On                                
C                                                                
C                   EndSr                                        
PCvtCharToNum     E                                              

Can anyone tell me why I am getting a machine error?

Marvin Radding
mradding@xxxxxxxxxxxx
                                            



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.