×

Good News Everybody!

The new search engine is LIVE!

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




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




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.