Common Constructs

The following attributes are common between all three utilities.

<SHOW specification>

── SHOW ─┬──────────────────────┬──────────────────────────────────────┤
         │ ┌◄─────── , ───────┐ │
         └─┴─<attribute name>─┴─┘

<SELECT specification>

           ┌◄──<logical expression>─┐
── SELECT ─┴─<selection expression>─┴──────────────────────────────────┤

<selection expression>

──<attribute name>──<relation>──<value>────────────────────────────────┤

<relation>

──┬─ = ──┬─────────────────────────────────────────────────────────────┤
  ├─ > ──┤
  ├─ < ──┤
  ├─ >= ─┤
  ├─ <= ─┤
  └─ <> ─┘

<value>

The value must be of the same type (integer, boolean, or string) as the attribute to which it is being compared.

Values for string attributes can be enclosed within quotation marks or apostrophes. These characters affect how a value is parsed. The following rules apply:

  • Quotation marks ( )

    Values delimited by quotation marks are case-sensitive. Characters that otherwise delimit strings (for example, commas , and colons (:) do not delimit strings when within quotation marks.

  • Apostrophes ()

    Values delimited by apostrophes can contain quotation-mark-delimited substrings. In these substrings, quotation marks are included in the delimited value.

The outermost quotation marks, if any exist, are always removed from the input value before it is used in a comparison. Strings do not require quotation marks unless one of the following is true:

  • The value contains blank spaces, commas, or colons.

  • The first character in the value is a quotation mark, and it is required in the input.

<logical expression>

──┬─ AND ─┬────────────────────────────────────────────────────────────┤
  ├─ , ───┤
  └─ OR ──┘

The use of a comma (,) in a logical expression has the same meaning as AND.

<SORT specification>

         ┌◄─────────────────────────────┐
         │         ┌◄─────── , ───────┐ │
── SORT ─┴─┬─ + ─┬─┴─<attribute name>─┴─┴──────────────────────────────┤
           └─ ─ ─┘

<output specification>

──┬─────────────┬─┬─────────────────────────────────────────────┬──────┤
  └─ SHOWINPUT ─┘ ├─ CSV ────┬─┬────────────────────────────────┤
                  ├─ FILE ───┤ └─<file title>───────────────────┤
                  ├─ TABBED ─┤                                  │
                  ├─ WFL ────┘                                  │
                  ├─ REM ─┬─────────────────────────────────────┤
                  │       └─<station name>─┬────────────────────┤
                  │                       └─ AT ──<hostname>────┤
                  │                  ┌◄─────── , ───────┐       │
                  ├─ TASKSTRING ──(──┴─<attribute name>─┴──)────┤
                  └─ PRINTER ───────────────────────────────────┘

By default, the output is reported to the ODT or remote station that initiated the utility. If the utility was initiated from a REMOTESPO session, the output is reported to the first available ODT. If the utility was initiated from a WFL job that was not initiated from an ODT or a REMOTESPO session, the output is reported to a printer file.

Note: The output destination cannot be a REMOTESPO session.

The output format depends on the number of specified attributes and whether the attributes fit on the width of the output device. Where possible, the output contains the following:

  • A one-line heading consisting of the attribute names.

  • One line per file, showing the file name and the attribute values. In some cases, the line might be split to accommodate long file names.

If the attributes cannot fit onto one line, they are listed as <attribute name> = <attribute value> with no heading.

Note: The <output specification> option is not valid with the MARC version of the PDIR command.

SHOWINPUT

Displays the parameters prior to this token. If both SHOWINPUT and TASKSTRING are specified, SHOWINPUT is ignored.

PRINTER

Directs the output to a printer.

CSV and TABBED <file title>

The CSV and TABBED options create a character-stream file containing the file attribute values in a format suitable for import to a spreadsheet program. Records are delimited with a carriage return and line feed. For the CSV option, attributes are delimited with a comma, and for the TABBED option, they are delimited with a tab.

If you do not specify a file title, the file is named <utility name>/“<5-digit task number>.CSV” for the CSV option and <utility name>/”<5-digit task number>.TXT” for the TABBED option, where <utility name> is PDIR, PMIX, or PUNIT.

The output contains the following:

  • A one-record heading consisting of the attribute names

  • One record per file, showing the file attribute values

You can append output to an existing file by setting the file attribute APPEND for the file CSV to TRUE. If APPEND is TRUE, the file to which output is being appended must already exist. If the existing file is not the output of a previous execution of PDIR with the same CSV or TABBED option, the results are unpredictable. The list of attribute names is not written to the updated file, and no check is made that the original attributes match the new attributes.

FILE <file title> and WFL <file title>

Note: WFL is only valid for the PDIR utility.

The FILE and WFL options create a disk file with a FILEKIND of JOBSYMBOL, a RECORDSIZE of 90 characters, and a BLOCKSIZE of 2520 characters. If you do not specify a file title, the file is named PDIR/<5-digit task number>.

You can append output to an existing file by setting the file attribute APPEND for the file DK to TRUE. If APPEND is TRUE, the file to which output is being appended must already exist. If the existing file is not the output of a previous execution of PDIR with the same WFL or FILE option, the results are unpredictable.

Because column widths are affected by the size of the actual data in a request, two identical PDIR requests (perhaps with different <file specification> variables) might use different column widths so that the list of attribute names is included for the APPEND request. The sequence numbers are based on the size of the original file rather than any sequence numbers in the file.

The WFL option produces a JOBSYMBOL file containing a list of file names suitable for input to the WFL compiler. The output file can be used by merging it into an existing JOBSYMBOL file, or by incorporating it into a job during compilation using the $INCLUDE control option.

Using the WFL option requires that the file name be the first reported attribute. In the output, if the file name does not fit in the space available in a single record, it is continued across as many records as are necessary, in accordance with the WFL syntax for continuing file names.

Each file name in the output file is followed by a comma. A percent sign precedes any other attribute values reported, causing the WFL compiler to treat them as comments. Since the last file name is followed by a comma, if the output file is included as part of a COPY or REMOVE statement, you should include a nonexistent file name after the included list of names for correct syntax.

If the WFL option is specified and the attributes specified cause nontabular <name> = <value output>, all attributes other than the name are discarded.

If the WFL option is specified and the file name attribute is not the first reported attribute, an error message is produced.

REM

Directs the output to a remote station.

You must specify a <station name> unless you run the program from a remote station or from a WFL job with STATIONNAME set to a valid remote station.

If you specify a <hostname>, PDIR uses Host Services logical I/O to send output to the specified station at the remote MCP host.

You can only specify REM without specifying a <station name> for tasks that are initiated from a REMOTE SOURCEKIND (for example, CANDE stations and WFL jobs with a valid STATIONNAME set).

The station name that you specify must be contained within a DATACOMINFO file or managed by a Message Control System (MCS), such as CANDE. Invalid station names result in the following error message from the MCS and the <PDIR request> is not performed.:

Could not open remote station <station name>

If you specify AT <hostname>, the value for <hostname> must be a valid BNA host. You can use the local host name.

TASKSTRING (<attribute name list>)

The TASKSTRING option returns attribute values through the TASKSTRING task attribute. The attribute names specified in parenthesis determine the attributes that are reported. The TASKSTRING option cannot appear with a SHOW clause.

For each object reported, the output consists of a list of attribute values separated by commas. Each list of attribute values is separated by a semi-colon. If all attribute values for an object are empty, the entire list for that object is suppressed. The output is limited to 254 characters; if truncation occurs, the last 3 characters are replaced by "..." and SW5 is set.

Explanation of Options

Option

Explanation

SHOW <attribute name>

Displays the value of the specified attribute. The format depends on the attribute type. Attribute names ending with “TIME” and the TIMESTAMP attribute report both time and date information. Attribute names ending with “DATE” report only date information.

SELECT <attribute name> <relation> <value>

Defines a selection expression that must be true for the file to be reported.

SORT <attribute name>

Returns the output sorted in the order of the value assigned to the attribute. A plus sign (+) designates ascending order, while a minus sign (–) designates descending order.