CICS PROGRAM ON ARITHMETIC OPERATIONS



Support for CICS/ESA, CICS/TS & Transaction Gateway, CICS Configuration Manager and CICS Performance Analyzer

CICS PROGRAM ON ARITHMETIC OPERATIONS

Postby avvarycobol » Mon Mar 28, 2011 8:35 pm

hi all.

MY PROGRAM IS ARITHMETIC ADDITION OPERATIONS, WHEN SPACES ARE ALLOWED IN FIELDS.

IDENTIFICATION DIVISION.
PROGRAM-ID. ARTH.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY DFHBMSCA.
COPY DFHAID.
COPY ARTSET.
77 A PIC X(2) VALUE 'AB'.
01 I PIC 9 VALUE 3.
01 J PIC 9 VALUE 3.
01 A1 PIC 999.
01 A2 PIC 999.
01 X PIC X(1).
88 NOT-FOUND VALUE 'A'.
PROCEDURE DIVISION.
EXEC CICS
HANDLE CONDITION
MAPFAIL(PARA)
END-EXEC.
IF EIBCALEN = 0
MOVE LOW-VALUES TO ARTMAPO
PERFORM SEND-MAP
ELSE
EVALUATE EIBAID
WHEN DFHENTER
PERFORM RECEIVE-MAP
WHEN DFHPF1
MOVE DFHBMFSE TO NUM1I
NUM2I
PERFORM RECEIVE-MAP
PERFORM ADD-PARA
PERFORM SEND-MAP
WHEN DFHPF3
EXEC CICS
RETURN
END-EXEC
WHEN OTHER
PERFORM RECEIVE-MAP
MOVE LOW-VALUES TO ARTMAPO
MOVE 'ENTER APPRORIATE KEY' TO MSGO
PERFORM SEND-MAP
END-EVALUATE
END-IF.
RECEIVE-MAP.
EXEC CICS
RECEIVE MAP('ARTMAP')
MAPSET('ARTSET')
INTO(ARTMAPI)
END-EXEC.
SEND-MAP.
EXEC CICS
SEND MAP('ARTMAP')
MAPSET('ARTSET')
FROM(ARTMAPO)
END-EXEC.
EXEC CICS
RETURN TRANSID('TID2')
COMMAREA(A)
END-EXEC.
ADD-PARA.
PERFORM UNTIL NOT-FOUND
IF NUM1I(I:1) IS NUMERIC
IF NUM2I(J:1) IS NUMERIC
MOVE NUM1I(1:I) TO A1
MOVE NUM2I(1:J) TO A2
COMPUTE RESULTO = A1 + A2
SET NOT-FOUND TO TRUE
ELSE
SUBTRACT 1 FROM J
END-IF
ELSE
SUBTRACT 1 FROM I
END-IF
END-PERFORM.
PARA.
MOVE 'ENTER APP VALUE' TO MSGO.
PERFORM SEND-MAP.

MY MAP HAVE THREE UNPROTECTED FIELDS

NUM1 WITH 9(3), NUM2 WITH 9(3) AND RESULT WITH 9(3).

WHEN I TRIGGER THE TRANSACTION FOR THE FIRST TIME RESULT IS COMING, ( EX- WHEN I GIVE 12 IN NUM1, AND 12 IN NUM2 I'M GETTING RESULT 024), AND FIRST THE SECOND TIME WHEN I GIVE OTHER OR SAME VALUES IM NOT GETTING ANY RESULT.

WHAT IS THE PROBLEM WITH MY PROGRAM.

PLZ CLARIFY.
avvarycobol
 
Posts: 5
Joined: Mon Mar 07, 2011 5:28 pm
Has thanked: 0 time
Been thanked: 0 time

Re: CICS PROGRAM ON ARITHMETIC OPERATIONS

Postby Robert Sample » Mon Mar 28, 2011 8:43 pm

1. Learn to use the Code button for code -- which preserves spacing and makes looking at code much easier.

2. Using all capitals in online messages is considering shouting and hence extremely rude.

3. Why is your program not using DFHCOMMAREA to track if it has been called before?

4. You need to describe, step by step, the exact steps you are doing when you have your problem. For example:
- sign onto CICS
- clear screen using CLEAR key
- enter transaction code
- map is displayed
- enter ...
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: CICS PROGRAM ON ARITHMETIC OPERATIONS

Postby BillyBoyo » Mon Mar 28, 2011 9:13 pm

If something "works" the first time and doesn't "work" the second time, check that everything is initialised properly. I can see multiple items which are not initialised. I can also see a potentially endless loop (although, curiously, because of the first problem it will only ever be entered once).

Unless you are able to return the program to its initial state each time (for me, not a good idea), I think you need to look at things closely before you continue with testing, because you have multiple errors without even looking at anything to do with CICS.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to CICS

 


  • Related topics
    Replies
    Views
    Last post