EAGREX4000E Error 40 running compiled



IBM's Command List programming language & Restructured Extended Executor

EAGREX4000E Error 40 running compiled

Postby xboss » Mon Dec 27, 2010 12:14 am

Here is my input record format,
#F0008802271737621656xxxx         yyyyyyyyy    #1212#?0089.96#10072#10277135854
#F0008804661726542806aaaaa        bbbbbb       #1006#?0068.68#10073#10277132437
#F0008808723752352124ccc          dddddd       #1311#?0041.64#10074#10277102041
#F0008801930376782118eeee         ffffff       #1201#?0023.43#10075#10277145440

column from 55 to 61 contains price
Column from 55 to 58 is dollar column
column from 60 to 61 is cent column
Here is my rexx code to get price value from the record
/* REXX */                                   
"EXECIO * DISKR INFILE (STEM RECORDS. FINIS" 
DO I = 1 TO RECORDS.0                         
   NUMBER.I =  SUBSTR(RIGHT(RECORDS.I,26),1,7)
END                                           
TOTAL = 0                                     
DO J = 1 TO RECORDS.0                         
                                             
  /*  NUMBER.J = C2D(NUMBER.J) */
  /*  NUMBER.J = C2X(NUMBER.J)    */         
    TOTAL = TOTAL + NUMBER.J                     
                                             
END                                           
SAY TOTAL                                     
EXIT                                         

Here I want to total all prices column.
I tried build in function such as C2D, C2X but most of the time I get error as listed below
EAGREX4000E Error 40 running compiled ?, line 9: Incorrect call to routine
EAGREX4010I Result not a whole number 

Any suggestion how am i gonna successfully total all the price column?
xboss
 
Posts: 79
Joined: Mon Nov 29, 2010 10:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: EAGREX4000E Error 40 running compiled

Postby enrico-sorichetti » Mon Dec 27, 2010 12:41 am

Any suggestion how am i gonna successfully total all the price column?
learn how to count :D

why do You complicate Your life?

rec.1="#F0008802271737621656xxxx         yyyyyyyyy    #1212#?0089.96#10072#10277135854"
rec.2="#F0008804661726542806aaaaa        bbbbbb       #1006#?0068.68#10073#10277132437"
rec.3="#F0008808723752352124ccc          dddddd       #1311#?0041.64#10074#10277102041"
rec.4="#F0008801930376782118eeee         ffffff       #1201#?0023.43#10075#10277145440"
rec.0=4

tot = 0
do   i = 1 to rec.0
   say "YOUR (WRONG) USELESS COMPLICATE MANGLING" SUBSTR(RIGHT(REC.I,26),1,7)
   say "CORRECT BUT STILL USELESS COMPLICATE MANGLING" SUBSTR(RIGHT(REC.I,25),1,7)
   say "CORRECT SIMPLE WAY " substr(rec.i,55,7)
   say
   tot = tot + substr(rec.i,55,7)
end
say tot
exit
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: EAGREX4000E Error 40 running compiled

Postby xboss » Mon Dec 27, 2010 4:55 am

Thanks enrico for your suggestion. But I still got an error,
Input format hex on,
%B0008800960160761680Robert Aderholt #1004#?0055.92#10102#10277140514
6CFFFFFFFFFFFFFFFFFFFD9889A4444444C889899A444447FFFF76FFFF4FF7FFFFF7FFFFFFFFFFF4
C2000880096016076168096259300000001459863300000B1004BF0055B92B10102B102771405140

%B0008808578829590779Spencer Bachus #1301#?0011.24#10103#10277115718
6CFFFFFFFFFFFFFFFFFFFE989889444444C888AA44444447FFFF76FFFF4FF7FFFFF7FFFFFFFFFFF4
C2000880857882959077927553590000002138420000000B1301BF0011B24B10103B102772149280

000001 /* REXX */                             
000002 "EXECIO * DISKR INFILE(STEM REC. FINIS"
000003 TOT = 0                               
000004 DO   I = 1 TO REC.0                   
000005    TOT = TOT + SUBSTR(REC.I,55,7)     
000006 END                                   
000007    SAY TOT                             
000008 EXIT                                   


Error Log
IEF237I 0D33 ALLOCATED TO STEPLIB                                         
IEF237I DMY  ALLOCATED TO SYSTSIN                                         
IEF237I JES2 ALLOCATED TO SYSTSPRT                                       
IEF237I 0D34 ALLOCATED TO INFILE                                         
EAGREX4100E Error 41 running compiled ?, line 5: Bad arithmetic conversion
IEF142I xxxxxxx EXECUTE - STEP WAS EXECUTED - COND CODE 3657             
IEF285I   xxxxxxx.LOAD                                 KEPT               


Error Description,
EAGREX4100E Error 41 running compiled program, line nn: Bad arithmetic
conversion

Explanation: In an arithmetic expression, a term was found that was not a valid number or that had an exponent outside the range of -999 999 999 through +999 999 999.

A variable might have been incorrectly used or an arithmetic operator might have been included in a character expression without being put in quotes. For example, the command MSG * Hi! should be written as 'MSG * Hi!', otherwise the program will try to multiply MSG by Hi!.

User Response: Check your code and correct it.
xboss
 
Posts: 79
Joined: Mon Nov 29, 2010 10:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: EAGREX4000E Error 40 running compiled

Postby xboss » Mon Dec 27, 2010 7:15 am

Enrico, I got it.
Problem is solved now.
Thank You.
Its not that I don't know how to count, but I have to do it for some other complex requirements. ;) ;) ;) ;)
Also my question was how to data type conversion for e.g. 'CHAR' datatype to 'NUM' datatype in REXX.
xboss
 
Posts: 79
Joined: Mon Nov 29, 2010 10:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: EAGREX4000E Error 40 running compiled

Postby NicC » Mon Dec 27, 2010 11:01 am

You do not need to convert datatypes in rexx, when char and num, Rexx Knows what type the data is. When it comes to using packed decimal then you need to unpack it.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: EAGREX4000E Error 40 running compiled

Postby xboss » Tue Dec 28, 2010 4:37 am

You are right NicC. The problem I have had was a char datatype in my records which I realized after scanning whole records:
say datatype(substr(rec.i,xx,x))
Now the problem is solved.
Thanks for the reply.
xboss
 
Posts: 79
Joined: Mon Nov 29, 2010 10:55 am
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post