#ACCEPT -- retrieves system task-related information

The #ACCEPT statement retrieves the following system task-related information:
idmscu
The #ACCEPT statement retrieves the following system task-related information:
  • Current task code
  • Task identifier
  • Logical terminal identifier
  • Physical terminal identifier
  • DC/UCF system version
  • The ID of the user signed on to the task's logical terminal
  • Physical terminal screen dimensions
This article describes the following information:
2
2
Syntax
  ►►─┬─────────┬────────────────────────────────────────────────────────────────►    └─ 
label
 ─┘  ►─── #ACCEPT TYPE= ─┬─ TASKCODE ──┬──────────────────────────────────────────►                      ├─ TASKID ────┤                      ├─ LTERMID ───┤                      ├─ SYSVERSN ──┤                      ├─ PTERMID ───┤                      ├─ USERID ────┤                      └─ SCRNSIZE ──┘  ►─── ,FIELD=
return-value-location-pointer
 ───────────────────────────────────►◄  
Parameters
TYPE=
Retrieves the requested information:
TASKCODE
Retrieves the 1- to 8-character code that invokes the current task.
TASKID
Retrieves the task identifier assigned by the system. The task identifier is a unique sequence number stored in a binary fullword numeric field. At system startup, the system sets the identifier to zero; each time a task is executed, the system increments the identifier by one.
LTERMID
Retrieves the 1- to 8-character identifier of the logical terminal associated with the current task.
SYSVERSN
Retrieves the version of the current DC/UCF system. The version number is an integer in the range 0 through 9999 stored in a binary halfword numeric field.
PTERMID
Retrieves the 1- to 8-character identifier of the physical terminal associated with the current task.
USERID
Retrieves the 32-character identifier of each user signed on to the logical terminal associated with the current task. If no user is signed on, the system returns blank.
SCRNSIZE
Retrieves the screen dimensions of the physical terminal associated with the current task. The screen size is returned in a field that is divided into two halfword fields: the first halfword contains the row, the second halfword contains the column. For example, a 24-line by 80-character screen is represented by a value of 24 in the first halfword and 80 in the second halfword. If the current task is not associated with a terminal, the system returns a null value of 0.
FIELD=
Specifies the location to which the system returns the requested task-related information.
return-value-location
A register that points to the field or the symbolic name of a user-defined field whose length is compatible with the length of the field containing the requested data.
Status Codes
After completion of the #ACCEPT statement, the value in register 15 indicates the outcome of the operation. The following is a list of the Register 15 value and the corresponding meaning:
  • X'00'
    The request has been serviced successfully.
  • X'04'
    An invalid return-value location address has been specified in the FIELD parameter.
  • X'08'
    #ACCEPT TYPE=PTERM was specified but no PTERM exists.
Example
The following example of the #ACCEPT statement retrieves the user ID of each user signed on to the logical terminal associated with the current task. This information is placed into the field USERSL2, which is defined in the application program's variable storage.
#ACCEPT TYPE=USERID,FIELD=USERSL2