|
This is from the IBM users manual, and seems to imply that you don't need to specify anything in the Special Names. JP 2.2.5.6.2 Using Data Areas You Create You can pass data between programs using data areas that you create. This information may be free-form data, such as informal messages, or may consist of a fully structured or formatted set of fields. You specify the library and the name of the data area when you create it. Using the Data Area formats (as opposed to the Local Data Area formats) of the ACCEPT and DISPLAY statements, you can access these data areas. The FOR phrase allows you to specify the name of the data area. Optionally, you can specify an IN LIBRARY phrase to indicate the OS/400 library where the data area exists. If the IN LIBRARY phrase is not specified, the library defaults to *LIBL. When you use the DISPLAY statement to write data to a data area you have created, it is locked by the system with a LEAR (Lock Exclusive Allow Read) lock before any data is written to the data area. If any other lock exists on the data area, the LEAR lock is not applied, and the data area is not written. By specifying the WITH LOCK phrase, you can keep the data area locked after the Display operation has completed. When you use the ACCEPT statement to retrieve data from a data area you have created, the system applies an LSRD (Lock Shared for Read) lock to prevent the data area from being changed while it is read. After the read is complete, the LSRD lock is removed, and a LEAR lock is placed on the data area if a WITH LOCK phrase was specified. For both the ACCEPT and DISPLAY statements, if a WITH LOCK phrase was not specified, any LEAR lock held prior to the statement will be removed. In ILE COBOL for AS/400 only one LEAR lock will be placed on a data area while the COBOL Run unit (activation group) is active. If any data areas remain locked when an activation group ends, the locks are removed. An ON EXCEPTION condition can exist for several reasons: Data area specified in the FOR phrase: - Cannot be found - You do not have authority to the data area - The data area was locked in a previous activation group or in another job AT position: - Was less than 1 or greater than the length of the data area. Internal and external floating-point data items can be passed using a data area. Internal floating-point numbers written to the data area using a DISPLAY statement are converted to external floating-point numbers. ILE COBOL for AS/400 supports decimal (*DEC), character (*CHAR), logical (*LGL), and DDM (*DDM) data areas. Regardless of the type of data area, information is moved to and from a data area left-justified. When referencing a decimal data area, or a logical data area, the AT position, if specified, must be 1. Data is moved in packed format to and from a decimal data area. A decimal data area is created with a specified number of total digits and decimal digits. This same number of digits must be declared in an ILE COBOL for AS/400 program accessing the decimal data area. For example: CL command to create the data area: CRTDTAARA DTAARA(QGPL/DECDATA) TYPE(*DEC) LEN(5 2) Partial ILE COBOL for AS/400 program to access data area: WORKING-STORAGE SECTION. 01 data-value. 05 returned-packed1 pic s9(3)v9(2) packed-decimal. PROCEDURE DIVISION. move 345.67 to returned-packed1. DISPLAY data-value UPON data-area FOR "DECDATA" LIBRARY "QGPL". ACCEPT data-value FROM data-area FOR "DECDATA" LIBRARY "QGPL". Finucci Domenico <Domenico.Finucci@Fid To: "'cobol400-l@midrange.com'" italia.it> <cobol400-l@midrange.com> Sent by: cc: cobol400-l-admin@midr Subject: R: Cobol/Seu and Data Areas ange.com 18/10/2002 16:00 Please respond to cobol400-l Hello, Howard; i'm sorry, i forgot to mention that my source is CBLLE. Sincerely Domenico Finucci Fiditalia , Milano, 02- 4301-2494 -----Messaggio originale----- Da: Weatherly, Howard [mailto:Howard.Weatherly@dlis.dla.mil] Inviato: venerd́ 18 ottobre 2002 16.47 A: 'cobol400-l@midrange.com' Oggetto: 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 ] Finucci, That was my first thought but look at this! May be something wrong wit SEU, certainly something wrong with me! :-) 0023.02 Special-Names. 0023.03 * Trans-Count is Data-Area 0023.04 Data-Area is Trans-Count <== Even checked if case sensitive nada! 0023.05 . 0024.00 Input-Output Section. F3=Exit F4=Prompt F5=Refresh F9=Retrieve F10=Cursor F11=Toggle F16=Repeat find F17=Repeat change F24=More keys Syntax error detected at 'DATA-AREA'. + Additional Message Information Message ID . . . . . . : LNC2913 Severity . . . . . . . : 30 Message type . . . . . : Diagnostic Message . . . . : Syntax error detected at 'DATA-AREA'. Cause . . . . . : The syntax rules for COBOL do not permit the identified item at this point in the program. -----Original Message----- >From: Finucci Domenico [mailto:Domenico.Finucci@Fiditalia.it] Sent: Friday, October 18, 2002 10:40 AM To: 'cobol400-l@midrange.com' Subject: R: Cobol/Seu and Data Areas Hello, Howard. This works: SPECIAL-NAMES. DATA-AREA is YourName WORKING STORAGE 01 WS-DTAARA pic x. PROCEDURE ... ACCEPT WS-DTAARA FROM YourName FOR "DTAARA Phisical name" Sincerely Domenico Finucci Fiditalia , Milano, 02- 4301-2494 -----Messaggio originale----- Da: Weatherly, Howard [mailto:Howard.Weatherly@dlis.dla.mil] Inviato: venerd́ 18 ottobre 2002 16.15 A: COBOL400-L@midrange. com (E-mail) Oggetto: 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 ] Has anyone used data areas in COBOL? I am running into an odd problem, here is a snippet of it: Create Data Area (CRTDTAARA) Type choices, press Enter. Data area . . . . . . . . . . . > DRDACNT Name Library . . . . . . . . . . . *CURLIB Name, *CURLIB Type . . . . . . . . . . . . . . > *DEC *DEC, *CHAR, *LGL, *DDM Length: Length . . . . . . . . . . . . 13 1-2000 Decimal positions . . . . . . 0 0-9 Initial value . . . . . . . . . 0 Text 'description' . . . . . . . Just a transaction counter Special-Names. Trans-Count is Data-Area . Input-Output Section. . . 1 WS-TRANS-COUNT. 2 TRANS-COUNT Pic S9(13) Packed-Decimal Value 0. 1 WS-MISC-VARIABLES. 2 WS-WORK-LIB Pic X(10) Value Space. 2 WS-NEW-RECORD. . . Accept WS-TRANS-COUNT from Data-Area for "DRDACNT" library WS-WORK-LIB . Display WS-TRANS-COUNT upon Data-Area for "DRDACNT" library WS-WORK-LIB . . 5722WDS V5R1M0 010525 LN IBM ILE COBOL for AS/400 TLMTDOBJ/LMTD615BT ENDEAVOR 10/16/02 10:25:42 Page 21 M e s s a g e s STMT * 11 MSGID: LNC0830 SEVERITY: 20 SEQNBR: 002303 Message . . . . : Environment-name expected, 'TRANS-COUNT' found. Environment-name CONSOLE assumed. * 181 MSGID: LNC1400 SEVERITY: 30 SEQNBR: 016502 Message . . . . : A feedback, local data area, data area, or attribute data mnemonic-name expected. Statement ignored. * 274 MSGID: LNC1396 SEVERITY: 30 SEQNBR: 025803 Message . . . . : Mnemonic-name of type LOCAL-DATA expected; 'DATA-AREA' found. Statement ignored. Now what is odd other than the above (which I may have wrong!) is in SEU. If I put the cursor on either of the "SPECIAL-NAMES." subsection or the declaration in it, SEU will show an error: Syntax error detected at 'TRANS-COUNT'. Additional Message Information Message ID . . . . . . : LNC2913 Severity . . . . . . . : 30 Message type . . . . . : Diagnostic ____________________________________________ Howard Weatherly Systems Advisor Computer Task Group, Inc. howard.weatherly@dlis.dla.mil Howard_weatherly@ameritch.net Howard.Weatherly@ctg.com "luck favors those who prepare" _______________________________________________ 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. _______________________________________________ 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. ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. Administrator@bif.ie **********************************************************************
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.