# where command

The where command displays the current execution status of all
 processes currently logged on to system or for selected port numbers.

**Synonyms:** w

## Syntax

```
 where {port.number{-port.number}} {user-ID} {(options)}
```

## Parameter(s)

| user-ID | Outputs status for a specific user-ID only. Quotation marks are optional in D3. |
| --- | --- |
| account | Outputs status for processes using the specified account name. |
| port.number {-port.number} | Outputs the status for the specified port or a range of ports. |

| options | a | Displays a character next to the PIBs information to indicate the license consumption type. Review the Description section for possible types. When used with the o option, you will see only those PIBs that are using a license.Note: In this mode, an asterisk is not displayed next to the port that issued the command. |
| --- | --- | --- |
| h | Suppresses the heading. | |
| l | Shows the status for each pushed level. | |
| n | No pause option suppresses the pause at the end of the page on the terminal. | |
| o | Shows information only for those PIBs that have the specified settings when used with the a option. | |
| p | Directs output to the system printer, via the spooler. | |
| u | Returns the user tally (under the Stat column heading). | |
| z | Displays where status for all ports, including inactive ports (those which are not currently logged on). | |

## Description

The following table describes the licensing characters displayed in the first column of the
 where (a command licensing information report:
| Licensing Character | Description |
| --- | --- |
| + | Direct connect line using User license |
| = | Phantom line |
| # | Phantom line using User license |
| - | Direct connect line using Connection Pool license |
| The where command displays this information:

| Ln | Port number. Note: An asterisk indicates the port that issued the command. |
| --- | --- |
| PCB FID | FID of the PCB for each port. |
| PIB STAT | PIB status of each port. |
| ABS base | Beginning FID of the ABS currently being executed by each port. |
| Stat | Current port status: |
| n | (Hexadecimal) Current TCL level. If blank, the port is at the primary level (level 1). |
| d | In system debugger. |
| p | Phantom process. |
| t | Tape attached. |
| u | When this option is used, the Stat fields contain the user tally code. Possible values for the user tally codes: |
| 0 | Port is logged off. |
| 1 | Port is pushed a level. |
| 2 | Port is in process of logging on. |
| 3 | Port is in break/end sequence. |
| 5 | Normal setting. |
| -1 | Spooler controlled process. |
| -2 | Scheduler process. |
| R1 & Return stack contents | Displays the ABS mode currently executing on the port. The first entry is the current location. Subsequent entries (separated by spaces) are the return stack mode addresses. If the display shows corrupted workspace, the most likely cause is that the workspace is not properly set up or the process is in the middle of push level or pop level. |
| w | Synonym of the where command. |

 Note: The where command (even with the Z option) only
 shows lines that have undergone some type of activity.

## Example(s)

**Example 1**

 The following example provides the status of those ports that are currently logged into the dm
 user-ID:

```
 where ’dm’
```

 **Example 2**

 The following example provides the status of port numbers 13 through 22:

```
 where 13-22
```

 **Example 3**

 The following example provides the status of all port numbers:

```
 where (z
```

 **Example 4**

 The following example shows the where (a report of direct connected lines
 using Connection Pool licenses (lines 2–5):

```
 :where (a

 Ln PCB PIB ABS Stat R1 & Return stack contents 04 Jan 2019
 FID Stat Base 10:08:34

 +0000 00000080 F310 000018 AU_INPUT:000 AU_START_TCL:000 AU_TCL:000
 TCL1:000
 +0001 00000081 FF90 000018 WS_WHERE1:000 WS_WHATWHERE:000
 -0002 00000082 E390 000018 PX_LOCK:000
 -0003 00000083 E390 000018 PX_LOCK:000
 -0004 00000084 E390 000018 PX_LOCK:000
 -0005 00000085 E390 000018 PX_LOCK:000
 0256 00000180 BF10 000018 SP_SLEEP:000 SP_SPOOLOUT:000
 =0257 0000450C FF00 000018 P RPS_GETCMD:000
 =0258 00004509 FF10 000018 P RPS_GETCMD:000
 =0259 00004515 FF10 000018 P RPS_GETCMD:000
 =0260 00004500 FF10 000018 P RPS_GETCMD:000
 =0261 00004508 FF10 000018 P RPS_GETCMD:000
 0273 00004484 BF10 000018 P PP_SCHED:000
```

 **Example 5**

 The following example shows the where (a report of direct connected lines
 using Enterprise licenses (lines 2–5):

```
 :where (a

 Ln PCB PIB ABS Stat R1 & Return stack contents 04 Jan 2019
 FID Stat Base 10:55:20

 +0000 00000080 F310 000018 AU_INPUT:000 AU_START_TCL:000 AU_TCL:000
 TCL1:000
 +0001 00000081 FF90 000018 WS_WHERE1:000 WS_WHATWHERE:000
 <0002 00000082 E390 000018 PX_LOCK:000
 <0003 00000083 E390 000018 PX_LOCK:000
 <0004 00000084 E390 000018 PX_LOCK:000
 <0005 00000085 E390 000018 PX_LOCK:000
 0256 00000180 BF10 000018 SP_SLEEP:000 SP_SPOOLOUT:000
 =0257 0000450C FF00 000018 P RPS_GETCMD:000
 =0258 00004509 FF10 000018 P RPS_GETCMD:000
 =0259 00004515 FF10 000018 P RPS_GETCMD:000
 =0260 00004500 FF10 000018 P RPS_GETCMD:000
 =0261 00004508 FF10 000018 P RPS_GETCMD:000
 0273 00004484 BF10 000018 P PP_SCHED:000
```

 **Example 6**

```
 where

 Ln PCB PIB ABS Stat R1 & Return stack Contents
 011 00060B BF10 000018 sp.serialsleep:080
 012 00060C FF10 000018 au.tcl.upd:084 au.start:36C
 013 00060D BF10 000018 sp.serialsleep:080
 014 00060E BF10 000018 sp.serialsleep:080
 015 00060F BF10 000018 sp.serialsleep:080
 019 000613 BF10 000018 sp.serialsleep:080
 045 0469F9 F310 000018 3 au.input:000 au.get.cmnd:0D8
 *056 046AA6 F310 000018 2 ws.where1:000 ws.whatwhere:354
 069 0457DD F310 000018 1 me.pause:018 me.display:598
 070 04514D F310 000018 1 me.pause:018 me.display:598
 074 00064A BF10 000018 sp.serialsleep:080
 082 000652 BF10 000018 sleepsub:0F4 br.rqm:18C
 128 000680 BF10 000018 P sp.sleep:040 sp.spoolout:0F0
 130 04AA25 FF10 000018 P br.unix.bix:000
 137 039A0B BF10 000018 P pp.sched:038
```

## See also

- [PIB status](https://d3codex.com/definitions/pib-status/)
- [pibstat command](https://d3codex.com/tcl/pibstat-command/)
- [Port number](https://d3codex.com/definitions/port-number/)
- [psr command](https://d3codex.com/tcl/psr-command/)
- [startsched command](https://d3codex.com/backgroundphantomprocess/startsched-command/)
- [t-verify command](https://d3codex.com/tcl/t-verify-command/)
- [u0011 user exit](https://d3codex.com/pickbasic-flashbasic/u0011-user-exit/)
- [u0079 user exit](https://d3codex.com/pickbasic-flashbasic/u0079-user-exit/)
- [u2117 user exit](https://d3codex.com/pickbasic-flashbasic/u2117-user-exit/)
- [u3b user exit](https://d3codex.com/pickbasic-flashbasic/u3b-user-exit/)
- [unlock-group command](https://d3codex.com/tcl/unlock-group-command/)
- [what command](https://d3codex.com/tcl/what-command/)
- [wherebt macro](https://d3codex.com/tcl/wherebt-macro/)
- [whered macro](https://d3codex.com/tcl/whered-macro/)
- [whereindx macro](https://d3codex.com/tcl/whereindx-macro/)
- [wherelk macro](https://d3codex.com/tcl/wherelk-macro/)
- [whereovf macro](https://d3codex.com/tcl/whereovf-macro/)
- [wherepu macro](https://d3codex.com/tcl/wherepu-macro/)
- [wheres command](https://d3codex.com/tcl/wheres-command/)
- [wheresp macro](https://d3codex.com/tcl/wheresp-macro/)
- [wheret macro](https://d3codex.com/tcl/wheret-macro/)

---
Source: https://d3codex.com/tcl/where-command/ - part of the D3Codex reference.
