View previous topic :: View next topic
|
Author |
Message |
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
Hi ,
I have a requirement like below.
I want to add 2 fields which are defined as 9(3).99.
If I add directly then it is giving SOC7 error.
Could you please advice.
Thanks.
Lakshmi |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
PIC 9(3).99 is an edit mask - x-type
NUMVAL them both to PIC 9(3)V99 (packed-decimal or display) fields
and then add the PIC 9(3)V99 fileds.
or you can:
COMPUTE PIC 9(4).99 = PIC 9(3)V99 + PIC 9(3)V99 end-compute
you might get away with:
COMPUTE PIC 9(4).99 = FUNCTION NUMVAL(PIC 9(3).99) + FUNCTION NUMVAL (PIC 9(3)V99) end-compute
I have not tested the last, so I don't know if the syntax is correct. |
|
Back to top |
|
|
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
Hi,
I gave the statement as below but I am getting an error.
Code: |
COMPUTE WS-SAL-AMT=FUNCTION NUMVAL(WS-IN-SAL-AMT) +
FUNCTION NUMVAL(WS-OUT-SAL-AMT)
********************************* Top of Data **********************************
START CCBC927 CERT LEVEL
REC:012547771MC200.02300.03400.0410.01000001
IGZ0097S Argument-1 for function NUMVAL in program RFIDEXT at displacement X'069
From compile unit RFIDEXT at entry point RFIDEXT at compile unit offset
at address 00007BD2. |
Please advice.
Could you suggest me with Redefines also.
Thanks |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What's the definition of WS-IN-SAL-AMT and WS-OUT-SAL-AMT? Where are they located in the record? |
|
Back to top |
|
|
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
Hi,
Below is the layout of i/p and o/p file.
01 INPUT-REC.
05 WS-IN-DLR-NO PIC X(09).
05 WS-IN-CARD-TYPE PIC X(02).
05 WS-IN-TRAN-AMT PIC 9(3).99.
05 WS-IN-SAL-AMT PIC 9(3).99.
01 OUTPUT-REC.
05 WS-OUT-DLR-NO PIC X(09).
05 WS-OUT-CARD-TYPE PIC X(02).
05 WS-OUT-TRAN-AMT PIC 9(06).99.
05 WS-OUT-SAL-AMT PIC 9(6).99.
Thanks. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
are the INPUT-REC and OUTPUT-REC defined in working-storage or FD section.
If in FD, insure both files have been opened.
Show us the complete error message. It has been truncated on the right.
show us a hex display of the input file.
how is WS-SAL-AMT defined? |
|
Back to top |
|
|
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
Hi,
Both Input-rec and output-rec are defined in FD and both files are opened.
Below is the error message.
REC:012547771MC200.02300.03400.0410.01000001
IGZ0097S Argument-1 for function NUMVAL in program RFIDEXT at displacement X'0692' contained no digits.
From compile unit RFIDEXT at entry point RFIDEXT at compile unit offset+00000692 at entry offset +00000692
at address 00007BD2.
<> LEAID ENTERED (LEVEL 11/10/2006 AT 10.12)
<> LEAID PROCESSING COMPLETE. RC=0
WS-SAL-AMT is defined as PIC 9(6).99.
Please advice how to get rid of this error .
Thanks in advice. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Quote: |
Argument-1 for function NUMVAL ... contained no digits. |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
You get rid of the error by putting some digits in the first field. You may want to display both fields before attempting the COMPUTE -- that could be enlightening. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
do you have any idea which record was involved - 1st?
in other words: is the compute before or after populating the output record?
you have two NUMVAL functions, each having an Arguement 1.
does not mean that it is the first NUMVAL in the COMPUTE statement. |
|
Back to top |
|
|
|