Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
OC7 while performing two fields...

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
View previous topic :: :: View next topic  
Author Message
Satyajit

New User


Joined: 25 Jan 2006
Posts: 27

PostPosted: Fri Aug 25, 2006 6:52 pm    Post subject: OC7 while performing two fields...
Reply with quote

This is the table structure that i am using...

CREATE TABLE STOCK3
(MERCHANT_ID CHAR (5) NOT NULL,
PRODUCT_ID CHAR (5) NOT NULL,
STOCK_VOLUME NUMERIC (5),
FOREIGN KEY (MERCHANT_ID) REFERENCES U122959.MERCHANT,
FOREIGN KEY (PRODUCT_ID) REFERENCES U122959.PRODUCT)
IN DB084811.TS001;
CREATE INDEX U122959.IXSTOCK3
ON U122959.STOCK3
*********************************************************
DCLGEN
*******************************************************
01 DCLSTOCK3.
* MERCHANT_ID
10 SMERCHANT-ID PIC X(5).
* PRODUCT_ID
10 SPRODUCT-ID PIC X(5).
* STOCK_VOLUME
10 SSTOCK-VOLUME PIC S9(5)V USAGE COMP-3.
*******************************************************

Input file

=COLS> ----+----1----+----2********* Top of Data ******************************
****** ***************************** Top of Data ******************************
000001 PRD0100001MER0100300
000002 PRD0100001MER0100400
****** **************************** Bottom of Data ****************************

Input file layout

FD ORDER-IN
LABEL RECORDS ARE STANDARD
RECORDING MODE IS F.
01 IN-ORDER-REC.
05 IN-FILE-PRODUCT-ID PIC X(05).
05 IN-ORDER-ID PIC 9(05).
05 IN-FILE-MERCHANT-ID PIC X(05).
05 IN-ORDER-QNT PIC 9(05).

Ws variables

01 IN-PRODUCT-ID PIC X(05).
01 WS-SSTOCK-VOLUME PIC S9(5)V USAGE COMP-3.
01 WS-SSTOCK-VOLUME-2 PIC S9(06).
01 WS-IN-ORDER-QNT PIC S9(06).
1********************************************************
I moved

DISPLAY '3100-BEFORE GREATER THAN'
MOVE SSTOCK-VOLUME TO WS-SSTOCK-VOLUME
MOVE WS-SSTOCK-VOLUME TO WS-SSTOCK-VOLUME-2
DISPLAY 'WS-SSTOCK-VOLUME-2=' WS-SSTOCK-VOLUME-2
DISPLAY 'WS-IN-ORDER-QNT=' WS-IN-ORDER-QNT
********
MOVE IN-ORDER-QNT TO WS-IN-ORDER-QNT
Then I compared
IF WS-IN-ORDER-QNT > WS-SSTOCK-VOLUME-2 *
Here I got 0C7 abend

Both

WS-SSTOCK-VOLUME-2
WS-IN-ORDER-QNT

Are displaying well but the moment I compare or try to perform any arithmetic function on them
I?m getting the error?why is it so???

Watch the SYSOUT

3100-BEFORE GREATER THAN
WS-SSTOCK-VOLUME-2=00500{
WS-IN-ORDER-QNT=00030{
CEE3207S The system detected a data exception (System Completion Code=0C7).
From compile unit PGM1 at entry point PGM1 at compile unit offset +0000
address 093292DC.
Back to top
View user's profile Send private message

mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 238
Location: USA

PostPosted: Fri Aug 25, 2006 9:49 pm    Post subject: Re: OC7 while performing two fields...
Reply with quote

Hi,

I dont know how you received this error but your code worked fine at my end.

Code:
WORKING-STORAGE SECTION.                               
                                                       
01  WS-SSTOCK-VOLUME            PIC S9(5)V USAGE COMP-3.
01  WS-SSTOCK-VOLUME-2          PIC S9(6).             
01  WS-IN-ORDER-QNT             PIC S9(6).             


Code:
DISPLAY 'ENTER DATA FOR COMPARISON'.               
MOVE    -134                TO WS-SSTOCK-VOLUME.   
ACCEPT  WS-IN-ORDER-QNT.                           
                                                   
MOVE WS-SSTOCK-VOLUME       TO WS-SSTOCK-VOLUME-2. 
                                                   
DISPLAY 'WS-SSTOCK-VOLUME-2 = ' WS-SSTOCK-VOLUME-2.
DISPLAY 'WS-IN-ORDER-QNT=     ' WS-IN-ORDER-QNT.   
                                                   
IF WS-IN-ORDER-QNT > WS-SSTOCK-VOLUME-2             
   DISPLAY 'WS-IN-ORDER-QNT    ' WS-IN-ORDER-QNT   
ELSE                                               
   DISPLAY 'WS-SSTOCK-VOLUME-2 ' WS-SSTOCK-VOLUME-2
END-IF.                                             
                                                   
STOP RUN.   



Regards
Mayuresh
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 -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us