Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to add two fields whiach are defined as 9(3).99

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Mon Mar 30, 2009 3:40 pm    Post subject: How to add two fields whiach are defined as 9(3).99
Reply with quote

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
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon Mar 30, 2009 3:50 pm    Post subject:
Reply with quote

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
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Mon Mar 30, 2009 7:28 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8119
Location: East Dubuque, Illinois, USA

PostPosted: Mon Mar 30, 2009 7:39 pm    Post subject:
Reply with quote

What's the definition of WS-IN-SAL-AMT and WS-OUT-SAL-AMT? Where are they located in the record?
Back to top
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Mon Mar 30, 2009 9:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon Mar 30, 2009 10:01 pm    Post subject:
Reply with quote

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
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Wed Apr 01, 2009 12:14 pm    Post subject:
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Apr 01, 2009 3:15 pm    Post subject:
Reply with quote

Quote:
Argument-1 for function NUMVAL ... contained no digits.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8119
Location: East Dubuque, Illinois, USA

PostPosted: Wed Apr 01, 2009 5:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Apr 01, 2009 5:13 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us