× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi, Jim,

Actually, I suspect many of my questions are very basic. I'm struggling to
deal with the DFHCOMMAREA, and trying to understand why it's behaving the
way it does.

For instance, the primary function of the screen I'm building is to read a
VSAM file sequentially, and find all records with the same employer account
number. They'll be displayed in descending order. When the account number
changes, I stop displaying the data.

Thus, I use a Startbr, Readnext process to read through the file. This
works perfectly when moving forward. With each press of the Scroll Forward
key, a new screen of records is displayed.

For debugging purposes, I display the account number, and the first and last
key that are on the screen on the bottom line of the screen, to prove that
these values are being stored in the DFHCOMMAREA. They are as I move
forward through the file.

The problem occurs when I press the key to start scrolling backward. At
that point, the account number is replaced by spaces. I know why this
happens, because I write it to the DFHCOMMAREA each time I execute a
successful startbr, and the program is failing on the STARTBR when going
backward.

In addition, the first key on the screen, the one I'll need to use to start
the browse backward, seems to become corrupted. The first four characters
of the 24-byte key are replaced by spaces, and the fifth by a B, though I
have no idea where that comes from, since the key is entirely numeric,
though it's stored in an alphanumeric field.

Because this key is now invalid, when it's used in the STARTBR operation,
the start browse fails.

Yet just before I pressed the Scroll back key, that key was displayed
properly on the screen, so I have no idea what happened to it.

The code for the Scroll backward process follows:

00136 IF EIBAID = DFHPF3
00137 PERFORM 7100-CLEAR-SCREEN THRU 7100-EXIT
00138 MOVE ACEMPNOI TO E-NUMBER ESD-EMP-ACCT-NO
00139 MOVE 0 TO E-SEQ
00140 PERFORM 1000-LOAD-BROWSE-KEY THRU 1000-EXIT
00141 PERFORM 1070-READ-EAFILE THRU 1070-EXIT
00142 SET ACMAP-CTR TO 12
00143 PERFORM 1111-START-BROWSE THRU 1111-EXIT
000144 PERFORM 1250-READ-PREV THRU 1250-EXIT
00145 UNTIL (ACMAP-CTR < 01)
00146 OR (RP-RESP = 20)
00147 OR (AC-EMPLOYER-ID < ACEMPNOI)
00148 PERFORM 1350-END-BROWSE THRU 1350-EXIT
00149 IF WS-AC-SSN1(1) NUMERIC
00150 MOVE WS-MSG04 TO ACERRO
00151 MOVE -1 TO ACEMPNOL
00152 PERFORM 7900-SEND-MAP-RETURN THRU 7900-EXIT
00153 ELSE
00154 PERFORM 7100-CLEAR-SCREEN THRU 7100-EXIT
00155 MOVE 0 TO AC-KEY
00156 MOVE ACEMPNOI TO AC-EMPLOYER-ID ESD-EMP-ACCT-NO
00157 MOVE ACEMPNOI TO E-NUMBER
00158 MOVE 0 TO E-SEQ
00159 SET ACMAP-CTR TO 1
00160 PERFORM 1070-READ-EAFILE THRU 1070-EXIT
00161 PERFORM 1100-START-BROWSE THRU 1100-EXIT
00162 PERFORM 1150-READ-NEXT THRU 1150-EXIT
00163 UNTIL (ACMAP-CTR > 12)
00164 OR (RN-RESP = 20)
00165 OR (AC-EMPLOYER-ID > ACEMPNOI)
00166 PERFORM 1350-END-BROWSE THRU 1350-EXIT
00167 MOVE WS-MSG05 TO ACERRO
00168 MOVE -1 TO ACEMPNOL
00169 PERFORM 7900-SEND-MAP-RETURN THRU 7900-EXIT.

...

00196 1000-LOAD-BROWSE-KEY.
000197 MOVE WS-COMM-FIRST TO AC-KEY.
00198 1000-EXIT. EXIT.

*** And this is where it fails ...

00284 1111-START-BROWSE.
00285 MOVE SPACES TO WS-COMM-BEGIN.
00286 EXEC CICS STARTBR
00287 DATASET('ACCOUNT')
00288 RIDFLD(AC-KEY)
00289 EQUAL
00290 RESP(BP-RESP)
00291 END-EXEC.
000292
000293 IF BP-RESP = DFHRESP(NORMAL)
00294 MOVE ACEMPNOI TO WS-COMM-BEGIN
00295 GO TO 1111-EXIT.
00296
00297 IF BP-RESP = DFHRESP(NOTFND)
00298 MOVE WS-MSG25 TO ACERRO
00299 MOVE -1 TO ACEMPNOL
00300 MOVE U-A-D-M TO ACEMPNOA
00301 PERFORM 7900-SEND-MAP-RETURN THRU 7900-EXIT
00302 ELSE
*** It always stops here, with a Resp of 16, INVREQ.

000303 PERFORM 7100-CLEAR-SCREEN THRU 7100-EXIT
00304 MOVE WS-MSG12 TO ACERRO
00305 MOVE -1 TO ACEMPNOL
00306 PERFORM 7900-SEND-MAP-RETURN THRU 7900-EXIT.
00307 1111-EXIT. EXIT.

-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx
[mailto:cobol400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jim Essinger
Sent: Saturday, February 02, 2008 3:28 PM
To: COBOL Programming on the iSeries/AS400
Subject: Re: [COBOL400-L] CICS Problem

Lora,

I think your questions are just fine here, as long as you realize that there
may be some differences between i5/OS COBOL (even the CICS version) and what
you are doing on a mainframe. What we have to offer may or may not help.
Ask away, and if we can, we will answer to the best of our knowledge.

Jim

On Feb 2, 2008 9:43 AM, Lora <loravara@xxxxxxxxxxx> wrote:

And I should take a moment to apologize here. I signed up for this
list about a year ago, when I began learning COBOL. COBOL is my first
programming language. I program on a mainframe at work, and have no
idea what kind of system is referred to here. I just assumed COBOL was
COBOL.

Since CICS is not supported, should I ask my CICS questions elsewhere,
or are there those out there who have programmed in CICS who wouldn't
mind the occasional stray question?

Thanks.

Lora


-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx
[mailto:cobol400-l-bounces@xxxxxxxxxxxx] On Behalf Of Harold Bearce
Sent: Tuesday, January 29, 2008 3:20 AM
To: COBOL Programming on the iSeries/AS400
Subject: Re: [COBOL400-L] CICS Problem

I gess I am showing my ignorance about the AS400. I never programmed
on one.

Bruce Vining <bvining@xxxxxxxxxxxxxxx> wrote: > BTW. CICS is not run
on the AS400 computers.

That will be a surprise to a few people :-) You may want to look at
product
5722-DFH: IBM CICSR Transaction Server for i5/OS

Bruce

Harold Bearce wrote:
I believe your logic is flawless. Check your punctuation carefully. BTW.
CICS is not run on the AS400 computers.

loravara@xxxxxxxxxxx wrote: I'm a very new CICS programmer, and I'm
running into a problem.

I'm trying to compare two data items. Both are PIC X(09). Both will
contain numbers, though.

At one point in the CICS program, I have:

IF ACEMPNOI = WS-COMM-BEGIN
NEXT SENTENCE
ELSE
PERFORM 1100-START-BROWSE THRU 1100-EXIT.

The problem is, the Else branch always triggers when the program
reaches this statement, as though the two data values are different,
even when I can verify that they are not.

ACEMPNOI is the field that receives the account number from the CICS map.
WS-COMM-BEGIN is the field in the DFHCOMMAREA that contains the last
ACEMPNOI that was searched on. I save it to this COMMAREA data item
whenever the program executes a successful STARTBR.

What am I doing wrong here?

Any advice would be appreciated.

Thanks.

Lora

--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L)
mailing list To post a message email: COBOL400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at http://archive.midrange.com/cobol400-l.




Harold Bearce
--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L)
mailing list To post a message email: COBOL400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/cobol400-l.




Bruce
Bruce Vining Services
507-206-4178
--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L)
mailing list To post a message email: COBOL400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/cobol400-l.




Harold Bearce
--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L)
mailing list To post a message email: COBOL400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/cobol400-l.

--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L)
mailing list To post a message email: COBOL400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/cobol400-l.


--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/cobol400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.