×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
Thanks Jon, that did the trick! Of course it would have helped if I had been
paying greater attention to the italics in the manual, even still it's a
poor example, yours however hit the nail on the head!

Since you mention the locks, I have a quick question: This data area is a
simple transaction counter however there can be more than one transaction
running at a time. If I specify with lock, and another transaction attempts
to retrieve the data area, will that take the "on exception" path?

-----Original Message-----
From: Jon Paris [mailto:Jon.Paris@Partner400.com]
Sent: Friday, October 18, 2002 7:02 PM
To: cobol400-l@midrange.com
Subject: RE: Cobol/Seu and Data Areas


The ability for ILE COBOL (not OPM COBOL) to access named data areas has
been supported since V3R7.  The basic syntax is like so:

DISPLAY/ACCEPT Sourcefield UPON/FROM  DataAreaSpecialName FOR DataAreaNAme
IN LibraryName AT StartPosition WITH LOCK ON EXCEPTION StuffToDo  NOT ON
EXCEPTION OtherStuffToDo END-DISPLAY.

Where DataAreaSpecialName is associated with the environment name DATA-AREA
in the SPECIAL-NAMES paragraph.  So your example should be coded like so and
will work just fine.

I deleted the original message so I can't check, but did your code include
the "Configuration Section" entry?  There appears to be a bug in the
compiler such that it does not diagnose this as missing, but will
erroneously flag other things (in particular SPECIAL-NAMES) as being
invalid.  Perhaps this caused your problem?

Here's roughly what your code should look like.

       Identification Division.
       Program-Id.  TESTPROG.
       Configuration Section.
       Special-Names.  DATA-AREA is Trans-Count.

       Data Division.
       Working-Storage Section.

       77 WS-TRANS-COUNT     Pic S9(13) Comp.
      * Other WS stuff here
       Procedure Division.
       Main.
           Accept WS-TRANS-COUNT from Trans-Count
                  for "DRDACNT" library WS-WORK-LIB.

           Display WS-TRANS-COUNT upon TransCount
                  for "DRDACNT" library WS-WORK-LIB.

Jon Paris
Partner400


_______________________________________________
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list
To post a message email: COBOL400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/cobol400-l
or email: COBOL400-L-request@midrange.com
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:

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

This mailing list archive is Copyright 1997-2026 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.