|
This is a multipart message in MIME format. -- [ Picked text/plain from multipart/alternative ] Howard. Yes, you are right. My experience is that a dataarea is a common area, so Pgm2 will meet a locked (or changed)dataarea if Pgm1 has done such a thing to it. Mvh. Geir Kildal "Weatherly, Howard" <Howard.Weatherly@dlis.dla.mil> Sent by: cobol400-l-admin@midrange.com 21.10.2002 15:57 Please respond to cobol400-l To: "'cobol400-l@midrange.com'" <cobol400-l@midrange.com> cc: Fax to: Subject: RE: Cobol/Seu and Data Areas 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. _______________________________________________ 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 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.