• Keine Ergebnisse gefunden

ACCEPT Statement

Im Dokument U I • System 80 (Seite 187-193)

Arithmetic Statements

6.6.1. ACCEPT Statement

Function

The ACCEPT statement causes low-volume data to be made available to the specified data item.

Format 1

ACCEPT identifierl[ERQM mnemonic-name]

I

Format 2

70044490-000

ACCEPT identifier FROM {DATE]

DAY TIME

6-23

Procedure Division

6-24

Format 3

ACCEPT cd-name MESSAGE COUNT Format 4

r - - - l

ACCEPT identifier-1 [,identifier-2] ...

I

FROM [SPECIFIC] mnemonic-name

I

[USING

{~~~:~!rier-3} 1 I I

[ON EXCEPTION lmperatlve-statementJ

. . I

L _____________________ J

Format 5

r - - - i

ACCEPT identifier-' FROM mnemonic-name [ON EXCEPTION imperative-statement]

L ______________ ~---~

Rules

1. The size of a data transfer is defined as follows:

SYSIN 80, 90, or 128 characters. If the length of a record is other than 80 or 96, 128 is used as the size of a data transfer. Records that are not 80 or 90 characters in length commonly occur when a job stream file is created/updated by the general editor.

SYSCONSOLE 60 characters

SYSCOM 12 characters

SYSSWCH 8 characters

SYSSWCH-n 1 character

SYSTEM-SHUTDOWN 1 character

SYSWORK 1 - 1,920 characters

SYSFORMAT 1 - 1,920 characters

SYSTERMINAL 60 characters

If the size of the data being transferred exceeds the appropriate size of a data transfer, the excess data is lost during a data transfer.

7004 4490-000

70044490-000

Procedure Division

Note: Rules 2 through 10 pertain to format 1 only.

2. The identifier must be defined implicitly or explicitly as USAGE IS DISPLAY.

3. The mnemonic-name must also be specified in the SPECIAL-NAMES paragraph of the Environment Division and must be associated with SYSIN, SYSCONSOLE, SYSCOM, SYSSWCH, SYSTERMINAL, SYSSWCH-n, SYSTEM-SHUTDOWN, or SYSWORK

4. The ACCEPT statement causes the transfer of data from a system logical device. This data replaces the content of the data item named by the identifier. No editing or error checking of the incoming data is performed.

5. If the mnemonic-name is associated with SYSIN or SYSCONSOLE and:

a. If the length of the receiving data item is less than or equal to the appropriate size of a data transfer, the transferred data is stored in the receiving data item left-aligned with space-fill or truncation to the right, when appropriate.

b. If the size of the receiving data item exceeds the appropriate size of a data transfer, the transferred data is stored left-aligned in the receiving data item. Additional data is requested and stored contiguously in the remaining portion of the receiving data item. When the remaining portion is less than or equal to the appropriate size, additional data is requested again. Transferred data is stored in the remaining portion with space-fill or truncation to the right as appropriate.

6. If the mnemonic-name is associated with SYSCOM, the 12-byte information in the communications region of the job preamble is moved to the 12-byte area described by the identifier.

7. If the mnemonic-name is associated with SYSSWCH, the information in the user program switch indicator (UPS!) byte is expanded to 8 bytes. Each byte represents an individual switch. If the mnemonic-name is associated with SYSSWCH-n, the appropriate switch is expanded to 1 byte.

8. If the mnemonic name is associated with SYSTEM-SHUTDOWN, the shutdown indicator in the system information block (SIB) is expanded to 1 byte, with a character value of 0 or 1 (hexadecimal FO or Fl). Hexadecimal Fl indicates that the system operator entered a shutdown command through the console and plans to terminate all system processing.

9. If thelFROM phraselis not specified, the system logical device SYSIN is assumed.

10. The 1* is not accepted as an end statement into the program when accepting embedded data.

6-25

Procedure Division

Note: Rules 11 through 14 pertain to format 2 only.

11. The ACCEPT statement causes the information requested to be transferred to the data item specified by the identifier according to the rules of the MOVE statement. DATE, DAY, and TIME are conceptual data items and, therefore, are not described in the COBOL program.

12. DATE is composed of the data elements: year of century, month of year, and day of month. The sequence of the data element codes is from high order to low order (left to right), year of century, month of year, and day of month.

Therefore, July 1,1968 would be expressed as 680701. DATE, when accessed by a COBOL program, behaves as if it had been described in the COBOL program as an unsigned elementary numeric integer data item six digits in length.

13. DAY is composed of the data elements year of century and day of year. The sequence of the data element codes is from high order to low order (left to right) year of century, day of year. Therefore, July 1,1968 would be

expressed as 68183. DAY, when accessed by a COBOL program, behaves as if it had been described in a COBOL program as an unsigned elementary numeric integer data item five digits in length.

14. TIME is composed of the data elements: hours, minutes, seconds, and hundredths of a second. TIME is based on elapsed time after midnight on a 24-hour clock basis; thus, 2:41 p.m. would be expressed as 14410000. TIME, when accessed by a COBOL program, behaves as if it had been described in a COBOL program as an unsigned elementary numeric integer data item eight digits in length. The minimum value of TIME is 00000000; the maximum value of TIME is 23595999.

Note: It is possible for the maximum number of hours to be 99 if the system generation parameter TIMER is set to NO or MIN.

Note: Rules 15 through 17 pertain to format 3 only.

15. Cd-name must reference an input CD.

16. The ACCEPT MESSAGE COUNT statement causes the MESSAGE COUNT field specified for cd-name to be updated to indicate the number of messages that exist in a queue, sub-queue-l, ... , sub-queue-3.

17. Upon execution of the ACCEPT MESSAGE COUNT statement, the content of the area specified by a communication description entry must contain at least the name of the symbolic queue to be tested. Testing the condition causes the contents of the data items referenced by data-name-10 (STATUS KEy) and data-name-ll (MESSAGE COUNT) of the area associated with the communication entry to be appropriately updated.

6-26 7004 4490-000

7004 4490-000

Division

Note: Rules 18 through 32 pertain to format 4 only.

, - - - -

-I

18. Format 4 is used to accept data from a workstation terminal that calls scree;l

I

format services. The FROM phrase must be specified.

I I

19. The data description of identifier-1 or identifier-2, ... , must not contain a

I

subordinate entry that specifies an OCCURS DEPENDING clause.

I

I

20. Mnemonic-name must also be specified in the SPECIAL-NAMES paragraph I of the Environment Division and must be associated with SYSFORMAT.

I

I

21. The literal must be a nonnumeric literal.

I I

22. The literal or the contents of identifier-3 is made up of a 1- to 8-character I name of the screen format.

I

I

23. More than one receiving data item may be specified. Identifier-1 or identifier-2 need not be described explicitly or implicitly as USAGE IS DISPLAY. If USAGE other than DISPLAY is specified, no data conversion is performed by the COBOL-generated object code. If data conversion is required, it must be specified in the controlling screen format.

I

24. The SPECIFIC phrase is meaningful only for a multivolume workstation. It indicates that data is to be accepted from a particular workstation terminal;

that is, the terminal indicated in the WS-ID field, if the CONTROL AREA clause is specified with the mnemonic-name in the SPECIAL-NAMES paragraph, or the terminal that participated in the most recently executed ACCEPT or DISPLAY statement that references the same mnemonic-name.

25. The ON EXCEPTION phrase must be specified if the mnemonic-name is declared in the SPECIAL-NAMES paragraph with the CONTROL AREA clause. The ON EXCEPTION phrase must not be specified if the

mnemonic-name is declared without the CONTROL AREA clause.

26. The ON EXCEPTION phrase is executed when the execution of the ACCEPT statement is unsuccessful. (See key code 1, 2, 3, or 9 in the "Status Key 1"

column in Table 4-1.)

27. A screen format must be specified for a given workstation before data can be accepted or displayed. A screen format may be specified via job control language or by the USING phrase of an ACCEPT or DISPLAY statement.

28. When the USING phrase of an ACCEPT statement specifies a format different from the current screen format on the last-used terminal, the new format must be an input-only screen format.

: 29. Another way of specifying a different screen format is to use the DISPLAY statement with the USING phrase referencing the new input-only screen : format. The new format is displayed on the terminal; but no data is

I

L __ transmitte~ t~the !~reen since it ~a~nput-only format. _ _ _ _ _ _ _

J

6-27

Procedure Division

6-28

r---~

30. For a multivolume workstation, the USING phrase of an ACCEPT

I I

statement that references a new screen format changes the screen only on I l o n e terminal; that is, the terminal indicated in the WS-ID field if the

I I

CONTROL AREA clause is specified, or the terminal most recently accessed

I

I

if the CONTROL AREA clause is not specified.

I

I

I

I

31. For a multivolume workstation, the terminal that responds to an ACCEPT

I I

statement whose USING phrase references a new screen format could be

I

different from the terminal whose screen format has been changed by the I,

I

very same ACCEPT statement.

I I

I

32. After an ACCEPT statement referencing a screen format that is erased after

I I

input (that is, option 3 of the ERASEIUNLOCK function was selected at

I I

screen format generation), the next ACCEPT or DISPLAY statement

I

I accessing the same terminal must include a USING phrase.

I

: Note: Rules 33 through 40 pertain to format 5 only.

i I

33. Format 5 is used to accept data from a workstation terminal without using

I

I

screen format services.

I

I I

I

34. Identifier-l must be specified explicitly or implicitly with the USAGE IS

I

I DISPLAY phrase.

I

: 35. The data description of identifier-lor identifier-2, ... , must not contain a II

subordinate entry that specifies an OCCURS DEPENDING clause.

36. The FROM phrase is required. Mnemonic-name must also be specified in the SPECIAL-NAMES paragraph of the Environment Division and must be associated with SYSWORK.

37. The ON EXCEPTION phrase must be specified if the mnemonic-name is declared in the SPECIAL-NAMES paragraph with the CONTROL AREA clause. The ON EXCEPTION phrase must not be specified if the

mnemonic-name is not described with the CONTROL AREA clause.

38. The ON EXCEPTION phrase is executed when the execution of the ACCEPT statement is unsuccessful. (See key code 1, 2, 3, or 9 in the "Status Key I"

column of Table 4-1.)

39. If the length of the receiving data item (identifier-I) exceeds 1920 characters, the transferred data is stored in the receiving data item left-aligned and space-filled. No additional data is requested. If the length of the receiving data item is less than 1920 characters, the transferred data is stored in the receiving data item left-aligned with space-fill or truncation to the right, when appropriate.

Procedure Division

Im Dokument U I • System 80 (Seite 187-193)