Вы находитесь на странице: 1из 236

unisys

ClearPath Enterprise Servers

Work Flow Language (WFL)


Made Simple
ClearPath MCP 18.0

April 2017 8807 7391-006


NO WARRANTIES OF ANY NATURE ARE EXTENDED BY THIS DOCUMENT. Any product or related information
described herein is only furnished pursuant and subject to the terms and conditions of a duly executed agreement to
purchase or lease equipment or to license software. The only warranties made by Unisys, if any, with respect to the
products described in this document are set forth in such agreement. Unisys cannot accept any financial or other
responsibility that may be the result of your use of the information in this document or software material, including
direct, special, or consequential damages.

You should be very careful to ensure that the use of this information and/or software material complies with the laws,
rules, and regulations of the jurisdictions with respect to which it is used.

The information contained herein is subject to change without notice. Revisions may be issued to advise of such
changes and/or additions.

Notice to U.S. Government End Users: This software and any accompanying documentation are commercial items
which have been developed entirely at private expense. They are delivered and licensed as commercial computer
software and commercial computer software documentation within the meaning of the applicable acquisition
regulations. Use, reproduction, or disclosure by the Government is subject to the terms of Unisys’ standard commercial
license for the products, and where applicable, the restricted/limited rights provisions of the contract data rights
clauses.

Unisys and other Unisys product and service names mentioned herein, as well as their respective logos, are
trademarks or registered trademarks of Unisys Corporation.
All other trademarks referenced herein are the property of their respective owners.
Contents
Section 1. Introduction

Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–1
Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–1
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
Documentation Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
How to Use This Manual. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2

Section 2. What You Can Do with WFL

Managing Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–1


Managing Work Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–2
Managing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–2
Compiling Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–3
Restarting Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–3
Supporting Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–3
Limitations of WFL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–4

Section 3. Submitting WFL Statements and Jobs

Sources for Submitting WFL Statements or Jobs . . . . . . . . . . . . . . . 3–1


CANDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–1
MARC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–4
ODT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–6
Operations Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–8
Using START Statement Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–9
Starting a Job Immediately . . . . . . . . . . . . . . . . . . . . . . . 3–9
Starting a Job with Parameters . . . . . . . . . . . . . . . . . . . . 3–9
Starting a Job with Optional Parameters . . . . . . . . . . . . . 3–9
Starting a Job for Syntax Checking Only . . . . . . . . . . . . . 3–10
Starting a Job at a Specific Time . . . . . . . . . . . . . . . . . . 3–10
Starting a Job from Another WFL Job . . . . . . . . . . . . . . 3–10
Starting Another Copy of the Same WFL Job . . . . . . . . . 3–11

Section 4. Job Structure

Overall Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–1

8807 7391-006 iii


Contents

Specifying a Job Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–1


Some Simple Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–1
Running a Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–2
Compiling a Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–2
Copying Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–2
Using Multiple Statements . . . . . . . . . . . . . . . . . . . . . . . 4–2
Formatting and Casing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–3
Adding Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–4
Including Statements from Another File . . . . . . . . . . . . . . . . . . . . . . 4–4
Other Structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–5

Section 5. Running Tasks

What Is a Task? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–1


Using the RUN Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–1
Preventing Accidental Task Restarts. . . . . . . . . . . . . . . . . . . . . . . . . 5–2
Controlling File Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–2
Using File Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–3
Using Data Specifications . . . . . . . . . . . . . . . . . . . . . . . . 5–4
Using Remote Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–5
Using Task Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–6
Equating the Usercode . . . . . . . . . . . . . . . . . . . . . . . . . . 5–6
Equating the Priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–7
Equating the Family Statement . . . . . . . . . . . . . . . . . . . . 5–7
Using Task Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–8
Declaring, Assigning, and Reading Task Variables . . . . . . . 5–9
Reading Various Types of Task Attributes . . . . . . . . . . . . . 5–9
Reusing Task Variables . . . . . . . . . . . . . . . . . . . . . . . . . 5–10
Using MYJOB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–10
Handling Task Terminations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–11
Checking Whether a Task Completed Successfully . . . . . 5–11
Aborting the Job if a Task Fails. . . . . . . . . . . . . . . . . . . . 5–12
Retrying a Task Until It Succeeds . . . . . . . . . . . . . . . . . . 5–12
Retrying a Task if Operator Approves . . . . . . . . . . . . . . . 5–13
Retrying a Task with Validated Operator Approval . . . . . . 5–14
Running Several Tasks at the Same Time . . . . . . . . . . . . . . . . . . . . 5–16
Flow of Control for Tasks. . . . . . . . . . . . . . . . . . . . . . . . 5–16
Why Run Tasks in Parallel? . . . . . . . . . . . . . . . . . . . . . . 5–17
Initiating Parallel Tasks . . . . . . . . . . . . . . . . . . . . . . . . . 5–17
Initiating Parallel and Sequential Tasks . . . . . . . . . . . . . . 5–17
Waiting for Tasks to Terminate. . . . . . . . . . . . . . . . . . . . 5–18
Waiting for Changes in Task Status . . . . . . . . . . . . . . . . 5–19
Waiting for a Task Attribute Value. . . . . . . . . . . . . . . . . . 5–20
Passing Parameters to a Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–20

iv 8807 7391-006
Contents

Matching the Parameter Types in a Program. . . . . . . . . . 5–20


Passing Parameters by Reference . . . . . . . . . . . . . . . . . 5–21

Section 6. Managing Files

Permanent Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–1


Directories on a ClearPath MCP System . . . . . . . . . . . . . 6–1
CHANGE: Renaming Disk Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–2
Renaming a Single File . . . . . . . . . . . . . . . . . . . . . . . . . . 6–2
Renaming a Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–2
Renaming Files on a Specified Family . . . . . . . . . . . . . . . 6–3
Family Substitution for CHANGE Statements . . . . . . . . . . 6–3
Renaming Multiple Targets . . . . . . . . . . . . . . . . . . . . . . . 6–3
Specifying the Family for Multiple Targets . . . . . . . . . . . . 6–4
Specifying Different Families for Multiple Targets . . . . . . . 6–4
Changing a File to a Different Family . . . . . . . . . . . . . . . . 6–4
Using String Expressions in CHANGE Statements . . . . . . 6–4
REMOVE: Removing Disk Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–5
Removing a Single File . . . . . . . . . . . . . . . . . . . . . . . . . . 6–5
Removing a Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–5
Family Substitution for REMOVE Statements . . . . . . . . . . 6–5
Removing Multiple Sets of Files . . . . . . . . . . . . . . . . . . . 6–5
Removing Files from Multiple Families . . . . . . . . . . . . . . 6–6
Using String Expressions in REMOVE Statements . . . . . . 6–6
Determining if a File Is Resident . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–6
Waiting for a File to be Resident . . . . . . . . . . . . . . . . . . . 6–7
Reading File Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–7
Changing File Security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–8
Changing Object Code File Attributes. . . . . . . . . . . . . . . . . . . . . . . . 6–9

Section 7. Copying Files

Copy Request Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–1


Submitting Copy Requests . . . . . . . . . . . . . . . . . . . . . . . 7–2
Copying Single Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–2
Copying Multiple Files . . . . . . . . . . . . . . . . . . . . . . . . . . 7–2
Copying Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–2
Copying All Files from Your Own Usercode . . . . . . . . . . . 7–2
Copying All Files from Another Usercode . . . . . . . . . . . . . 7–3
Copying All Usercoded Files on a Family . . . . . . . . . . . . . 7–3
Copying Nonusercoded Files on a Family . . . . . . . . . . . . . 7–3
Copying All Files on a Family . . . . . . . . . . . . . . . . . . . . . . 7–3
Renaming Files during the Copy . . . . . . . . . . . . . . . . . . . 7–4
Renaming Directories during the Copy . . . . . . . . . . . . . . . 7–4

8807 7391-006 v
Contents

Changing the Usercode during the Copy . . . . . . . . . . . . . 7–4


Copying Files from Multiple Sources . . . . . . . . . . . . . . . . 7–4
Copying Files to Multiple Destinations . . . . . . . . . . . . . . . 7–4
Copying Files from Multiple Sources to Multiple
Destinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–5
Combining Separate Copy Requests . . . . . . . . . . . . . . . . 7–5
Using String Expressions in COPY Statements . . . . . . . . . 7–5
Using COPY Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–6
Usercode Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–6
KIND Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–6
FAMILY Defaults. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–7
Preserving Existing Files at the Destination . . . . . . . . . . . . . . . . . . . 7–8
Adding Files from a Directory . . . . . . . . . . . . . . . . . . . . . 7–8
Adding the Same Files to Multiple Destinations . . . . . . . . 7–8
Updating Files by Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–8
Determining Copy Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–9
Library Maintenance Tasks . . . . . . . . . . . . . . . . . . . . . . . 7–9
Monitoring Progress of a Copy. . . . . . . . . . . . . . . . . . . . 7–10
Copying to the CD-ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–10
Track at Once . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–11
Packet Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–11
Multivolume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–12
CD Copies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–12
Copying to or from Tape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–14
Library Maintenance Tapes . . . . . . . . . . . . . . . . . . . . . . 7–14
Selecting a Source Tape . . . . . . . . . . . . . . . . . . . . . . . . 7–15
Selecting a Destination Tape . . . . . . . . . . . . . . . . . . . . . 7–16
Specifying Whether to Unload the Tape . . . . . . . . . . . . . 7–18
Copying from Multiple Sources to a Single Tape . . . . . . . 7–18
Compressing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–18
Locking the Tape. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–19
Using Multireel Tape Sets . . . . . . . . . . . . . . . . . . . . . . . 7–19
Understanding Tape Directories . . . . . . . . . . . . . . . . . . . 7–22
Using Tape Directory Disk Files . . . . . . . . . . . . . . . . . . . 7–23
Expanding Library Maintenance Tapes . . . . . . . . . . . . . . 7–25
Advanced Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–26
Assigning Task Attributes to the Copy . . . . . . . . . . . . . . 7–27
Improving Copy Efficiency with the BLOCKSIZE
Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–27
Ensuring the Accuracy of Copied Data . . . . . . . . . . . . . . 7–27
Specifying Physical Disk Packs . . . . . . . . . . . . . . . . . . . 7–28
Specifying How Errors Are Handled . . . . . . . . . . . . . . . . 7–29
Copy Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–30
Determining if the Copy Was Successful . . . . . . . . . . . . 7–30

vi 8807 7391-006
Contents

Determining Which Files Were Copied . . . . . . . . . . . . . 7–31


Determining Why a Copy Failed. . . . . . . . . . . . . . . . . . . . . . . . . . . 7–32
DSS INACTIVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–32
END-OF-FILE READING HDR1 LABEL <file name> . . . . 7–32
<file name> NOT ON <family name> . . . . . . . . . . . . . . 7–33
<file name> NOT ON <tape name> . . . . . . . . . . . . . . . 7–33
HOST UNKNOWN OR NOT NETWORKING . . . . . . . . . . 7–34
Security Violation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–34
TAPE FILE MISSING . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–35
TASK IS NOT PRIVILEGED TO COPY THIS
DIRECTORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–35
Handling Waiting Copy Requests. . . . . . . . . . . . . . . . . . . . . . . . . . 7–35
(FAMILYINDEX <number>) SECTORS REQUIRED ON
<family> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–35
NO FILE <file name> (MT) . . . . . . . . . . . . . . . . . . . . . . 7–36
REQUIRES MT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–37
RECOPY REQUIRED. . . . . . . . . . . . . . . . . . . . . . . . . . . 7–37
Copying Files Between Hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–39
File Transfer Services . . . . . . . . . . . . . . . . . . . . . . . . . . 7–39
Local Hosts and Remote Hosts . . . . . . . . . . . . . . . . . . . 7–39
Monitoring Progress of File Transfer Tasks . . . . . . . . . . . 7–40
Copying Files with Native File Transfer (NFT) . . . . . . . . . . . . . . . . . 7–41
Copying to a Remote Host . . . . . . . . . . . . . . . . . . . . . . 7–41
Copying from a Remote Host . . . . . . . . . . . . . . . . . . . . 7–41
Copying Files Between Remote Hosts . . . . . . . . . . . . . . 7–41
Copying from Tapes on Remote Hosts . . . . . . . . . . . . . . 7–41
Copying to Tapes on Remote Hosts . . . . . . . . . . . . . . . . 7–42
Copying between Tapes on Remote Hosts . . . . . . . . . . . 7–42
NFT Copy Restarts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–42
Copying Files with File Transfer Protocol (FTP) . . . . . . . . . . . . . . . . 7–45
Foreign Host to Local MCP Server FTP Transfers . . . . . . 7–45
Local MCP Server to Foreign Host FTP Transfers . . . . . . 7–49
Local MCP Server to Remote MCP Server FTP
Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–51
Remote MCP Server to Local MCP Server FTP
Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–55
Preserving File Attributes in MCP Transfers . . . . . . . . . . 7–55
Copying a Directory of Files to or from a Remote Host . . 7–56
FTP Copy Restarts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–56

Section 8. Wrapping and Unwrapping Files

Wrapping Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–1


Using the WRAP Statement . . . . . . . . . . . . . . . . . . . . . . 8–1
Wrapping Single Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–2

8807 7391-006 vii


Contents

Wrapping Multiple Files . . . . . . . . . . . . . . . . . . . . . . . . . 8–2


Wrapping Files to Families . . . . . . . . . . . . . . . . . . . . . . . 8–2
Wrapping Directories of Files. . . . . . . . . . . . . . . . . . . . . . 8–2
Wrapping Files into Containers . . . . . . . . . . . . . . . . . . . . 8–3
Unwrapping Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–4
Unwrapping Single Files . . . . . . . . . . . . . . . . . . . . . . . . . 8–4
Unwrapping Directories of Files . . . . . . . . . . . . . . . . . . . . 8–4
Unwrapping Files to a New Disk . . . . . . . . . . . . . . . . . . . 8–5
Unwrapping Container Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–5
Security Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–6

Section 9. Printing Files

Printing Files and Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–1


Specifying Print Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–1
Choosing the Printer Destination . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–2
Specifying the Number of Copies . . . . . . . . . . . . . . . . . . . . . . . . . . 9–2
Specifying When Printing Takes Place . . . . . . . . . . . . . . . . . . . . . . . 9–2
Specifying When the Print Request Is Created . . . . . . . . . 9–2
Specifying When the File Should be Printed . . . . . . . . . . . 9–3
Controlling Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–4
Controlling Headers and Trailers. . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–4
Controlling Banner Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–5

Section 10. Compiling Programs

Specifying the Source Code File . . . . . . . . . . . . . . . . . . . . . . . . . . 10–1


Naming the Object Code File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–1
Choosing the Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–1
Choosing Whether to Save or Execute the Program . . . . . . . . . . . . 10–2
Using Compiler Control Options. . . . . . . . . . . . . . . . . . . . . . . . . . . 10–2
Preventing COBOL85 Formatting Errors. . . . . . . . . . . . . 10–3
Controlling Program Listings and Error Listings . . . . . . . . 10–4
Producing Cross-Reference Information . . . . . . . . . . . . . 10–5
Using Patch Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–5
Using Task and File Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–7
Applying to Compilation or Code File . . . . . . . . . . . . . . . 10–7
Modifying Code File Equations Later . . . . . . . . . . . . . . . 10–8
Checking Whether the Compilation Was Successful. . . . . . . . . . . . 10–8

Section 11. Managing Work Flow

Assigning Job Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11–1


Using Job Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11–2
Job Queue Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . 11–2

viii 8807 7391-006


Contents

Limits and Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11–4


Example Job Queues . . . . . . . . . . . . . . . . . . . . . . . . . . 11–4
Selecting a Start Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11–6
Running a Job on Regular Basis. . . . . . . . . . . . . . . . . . . . . . . . . . . 11–7
Starting the Job Every Day . . . . . . . . . . . . . . . . . . . . . . 11–7
Starting the Job on Weekdays. . . . . . . . . . . . . . . . . . . . 11–7

Section 12. Flow of Control

BEGIN...END: Grouping Statements Together. . . . . . . . . . . . . . . . . 12–1


IF: Making a Choice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–1
The Simple IF Statement. . . . . . . . . . . . . . . . . . . . . . . . 12–2
Providing an Alternative with IF ELSE . . . . . . . . . . . . . . 12–3
Stringing IF Statements. . . . . . . . . . . . . . . . . . . . . . . . . 12–3
Nesting IF Statements . . . . . . . . . . . . . . . . . . . . . . . . . 12–3
CASE: Choosing Between Many Alternatives . . . . . . . . . . . . . . . . . 12–4
GO TO: Jumping to a Statement Elsewhere in the Job . . . . . . . . . . 12–6
WHILE and DO: Repeating Statements in loops . . . . . . . . . . . . . . . 12–6
Repeating an Action While a Condition Is Met: WHILE
Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–7
Repeating an Action Until a Condition Is Met: DO
Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–8
Repeating an Action a Fixed Number of Times . . . . . . . . 12–8
Subroutines: Reusing Statements at Various Points in the Job. . . . . 12–9
Using Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–10
Exiting Early . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–11
Additional Features . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–11
WAIT: Interrupting the Job Temporarily. . . . . . . . . . . . . . . . . . . . . 12–12
Waiting for a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–12
Waiting for an Operator OK . . . . . . . . . . . . . . . . . . . . . 12–12
Waiting for a Length of Time . . . . . . . . . . . . . . . . . . . . 12–12
Waiting for Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–12
ABORT and STOP: Interrupting the Job Permanently . . . . . . . . . . 12–13

Section 13. Working with Data

Variables: Using Placeholders for Data . . . . . . . . . . . . . . . . . . . . . . 13–1


Job Parameters: Making Your Job Flexible . . . . . . . . . . . . . . . . . . . 13–3
Supplying All Parameters. . . . . . . . . . . . . . . . . . . . . . . . 13–4
Omitting Optional Parameters . . . . . . . . . . . . . . . . . . . . 13–4
Supplying Some Parameters . . . . . . . . . . . . . . . . . . . . . 13–4
Booleans: Evaluating Truth Conditions . . . . . . . . . . . . . . . . . . . . . . 13–4
Checking the State of a Task . . . . . . . . . . . . . . . . . . . . . 13–5
Checking Task Attribute Values . . . . . . . . . . . . . . . . . . . 13–5
Checking File Attribute Values . . . . . . . . . . . . . . . . . . . . 13–6

8807 7391-006 ix
Contents

Comparing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13–6


Creating Complex Boolean Expressions . . . . . . . . . . . . . 13–7
Numeric Values: Doing Your Arithmetic . . . . . . . . . . . . . . . . . . . . . 13–8
Integers and Reals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13–8
Numeric Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13–8
Complex Numeric Expressions . . . . . . . . . . . . . . . . . . . 13–9
Strings: Storing and Modifying Text . . . . . . . . . . . . . . . . . . . . . . . . 13–9
Combining Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13–9
Building File Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13–9
Modifying a String. . . . . . . . . . . . . . . . . . . . . . . . . . . . 13–11
Converting a String to Uppercase or Lowercase
Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13–21
Converting between Strings and Numbers . . . . . . . . . . 13–21

Section 14. Communicating with the Operator

Displaying Information to Operators . . . . . . . . . . . . . . . . . . . . . . . . 14–1


DISPLAY: Displaying a Message Temporarily . . . . . . . . . 14–1
INSTRUCTION: Storing a Message for Later Display. . . . 14–2
FETCH: Forcing the Operator to Read a Message. . . . . . 14–2
Receiving Information from Operators . . . . . . . . . . . . . . . . . . . . . . 14–3
WAIT: Waiting for a HI Command . . . . . . . . . . . . . . . . . 14–3
TASKVALUE: Waiting for a Number . . . . . . . . . . . . . . . . 14–3
ACCEPT: Waiting for a String. . . . . . . . . . . . . . . . . . . . . 14–4
SW1 through SW8: Waiting for Booleans . . . . . . . . . . . . 14–4

Section 15. Security

Protecting Disk Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15–1


Default Usercode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15–1
Default SECURITYTYPE . . . . . . . . . . . . . . . . . . . . . . . . 15–1
Nonusercoded Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 15–1
Changing File Security. . . . . . . . . . . . . . . . . . . . . . . . . . 15–2
Specifying Multiple Files and Directories . . . . . . . . . . . . 15–2
Understanding Job Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15–2
COPY or ADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15–3
CHANGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15–3
REMOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15–3
RUN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15–3
START . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15–3

Section 16. Examining the System Environment

Getting the Date and Time. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16–1


Getting System Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16–2

x 8807 7391-006
Contents

Hostname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16–2
Serial Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16–2
System Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16–2
MCP Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16–3

Section 17. Designing Jobs for Restarts

Planning Simple Job Restarts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17–1


Restarting Copies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17–3
Aborting the Job on Restart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17–3

Section 18. Debugging WFL Jobs and Tasks

Correcting Syntax Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18–1


Starting a Job for Syntax Checking Only . . . . . . . . . . . . . 18–1
Format of Syntax Error Messages . . . . . . . . . . . . . . . . . 18–1
Cascading Syntax Errors . . . . . . . . . . . . . . . . . . . . . . . . 18–2
Delayed Syntax Errors . . . . . . . . . . . . . . . . . . . . . . . . . . 18–3
Correcting Run-Time Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18–5
Using Job Messages . . . . . . . . . . . . . . . . . . . . . . . . . . 18–5
Data-Dependent Errors . . . . . . . . . . . . . . . . . . . . . . . . . 18–7
Adding DISPLAY Statements . . . . . . . . . . . . . . . . . . . . . 18–8
Using the Job Summary . . . . . . . . . . . . . . . . . . . . . . . . 18–9
Requesting Program Dumps for Tasks . . . . . . . . . . . . . 18–11
Creating Cross-Reference Files . . . . . . . . . . . . . . . . . . . . . . . . . . 18–12

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1

8807 7391-006 xi
Contents

xii 8807 7391-006


Section 1
Introduction

Purpose
WFL Made Simple introduces you to the most commonly used features of Work Flow
Language (WFL).

WFL is a programming language for writing batch jobs. WFL includes features for running
programs, modifying their behavior, and monitoring their progress.

WFL also includes features for file maintenance. The most important of these is the COPY
statement, which you can use in a WFL job or enter as a command in CANDE, MARC,
Operations Center, or at an ODT.

Scope
WFL Made Simple uses examples to teach you the basics of using WFL. This manual is
not intended as a complete reference to WFL. Rather, it is a companion to the Work Flow
Language (WFL) Programming Reference Manual.

Refer to WFL Made Simple if


• You are new to WFL.
• You do not know which statement to use to accomplish a particular goal.
• You prefer an example-based approach to learning.

Refer to the Work Flow Language (WFL) Programming Reference Manual if


• You want detailed descriptions of all statements, including the less common ones.
• You want to see diagrams that express WFL syntax in a formal way.
• You need discussions of the details of each statement, such as exceptions,
restrictions, and side effects.

Another related manual is the Task Management Programming Guide. Refer to that
manual for discussions of
• Tasking concepts
• Running jobs or tasks on remote hosts in a network
• Restarting jobs and tasks

8807 7391-006 1–1


Introduction

Audience
The audience for WFL Made Simple includes
• Programmers, who can use this manual to learn how to compile programs or how to
initiate them from a job shell
• Operators, who can use some WFL statements as commands, or who can write jobs
to automate some system operations

Documentation Updates
This document contains all the information that was available at the time of
publication. Changes identified after release of this document are included in problem list
entry (PLE) 19163521. To obtain a copy of the PLE, contact your Unisys service
representative or access the current PLE from the Unisys Product Support website:

http://www.support.unisys.com/all/ple/19163521

Note: If you are not logged into the Product Support site, you will be asked to do so.

Prerequisites
To use WFL Made Simple, you should already be familiar with some basic system
concepts (for example, you should know what an ODT is and what system commands
are). You should know what MARC and CANDE are. You should also be familiar with some
method of editing files on the MCP server, such as CANDE page mode or the Editor.

You will find WFL easier to learn if you have some programming experience. However,
you can use this manual even if you have never written a program before. If you are new
to programming, you will find the information in Section 18, Debugging WFL Jobs and
Tasks, to be particularly useful.

How to Use This Manual


Overall Organization

To learn about the major capabilities of WFL, refer to Section 2, What You Can Do with
WFL.

To learn how to achieve a particular goal or effect, scan through the Table of Contents. The
headings are organized by topic.

To find information about a particular statement when you know the name of the
statement, refer to the Index.

1–2 8807 7391-006


Introduction

MCP Server Terminology

In this book, the term “MCP server” refers to the MCP server component of a ClearPath
MCP system.

8807 7391-006 1–3


Introduction

1–4 8807 7391-006


Section 2
What You Can Do with WFL

Programs usually fall into one of two categories:

Interactive programs

Accept real-time transactions from a user and display the results immediately. Examples
are word processors and programs that query databases.

Batch programs

Run in the background and have little or no interaction with the user. Batch programs
sometimes take a long time to run, or consume a major share of the system processor
time. Consequently, you must manage batch programs carefully to prevent them from
conflicting with each other or slowing down interactive programs.

Work Flow Language (WFL) is designed primarily for managing batch programs. This
section introduces the following topics related to the capabilities of WFL:
• Managing Tasks
• Managing Work Flow
• Managing Files
• Compiling Programs
• Restarting Tasks
• Supporting Capabilities
• Limitations of WFL

Managing Tasks
Programs written in WFL are referred to as WFL jobs. These WFL jobs exist primarily to
execute programs written in other languages. The programs initiated from a WFL job are
referred to as tasks.

8807 7391-006 2–1


What You Can Do with WFL

WFL task management features include the following:


• Task equations
Options that modify the behavior of tasks
• File equations
Options that can cause a task to use different files, or to use files in a different way
than it otherwise would
• Parameters
Items of data that serve as input to a task
• Task status queries
Expressions you can use to check whether a task completed normally, before
initiating the next task
• Parallel execution
The ability to run several tasks at the same time

For detailed information, see Section 5, Running Tasks.

Managing Work Flow


WFL work flow management features include the following:
• Priorities
Assignments that influence the way the system divides its resources among
competing jobs and tasks
• Job queues
Structures that limit how many jobs of a given type can run at the same time
• Limits
Assignments that limit the usage of various resources by a job or its tasks
• Start times
Assignments that specify the date and time when a job is to start or that run the job on
a regular basis

For detailed information, see Section 11, Managing Work Flow.

Managing Files
WFL file management features include the following:
• CHANGE and REMOVE
Statements that retitle or remove disk files. See Section 6, Managing Files.

2–2 8807 7391-006


What You Can Do with WFL

• COPY
A statement that copies disk files or backs up disk files to tape. See
Section 7, Copying Files.
• PRINT
A statement that submits files for printing. You can set a number of options to control
the destination and appearance of the printed output. See Section 9, Printing Files.

Compiling Programs
The WFL COMPILE statement enables you to specify each of the following:
• Compiler name
Specifies the compiler to use.
• Program disposition
Saves or executes the compiled program.
• Data specifications
Supply input data for the compiler. For example, can supply options that control the
creation of program listings, cross-reference files, and error files.
• Patches
Specify patch files to be merged with the program source.
• File or task equations
Specify file or task equations for the compilation, for the compiled program, or for
both.

For detailed information, see Section 10, Compiling Programs.

Restarting Tasks
WFL jobs are automatically restarted if they are interrupted by a halt/load. The job typically
skips any tasks that completed before the halt/load, and restarts any tasks that were in
progress at the time of the halt/load. For detailed information, see Section 17, Designing
Jobs for Restarts.

Supporting Capabilities
WFL provides a number of features that play an assisting role for the major features
discussed previously. These features include:
• Flow of control
Statements that perform other statements conditionally, repetitively, or in an unusual
order. You also can use subroutines to store groups of statements for occasional use.
Refer to Section 12, Flow of Control.

8807 7391-006 2–3


What You Can Do with WFL

• Variables and expressions


Constructs that store or return various types of data, including Boolean, integer, real,
and string data. Refer to Section 13, Working with Data.
• Operator communications
Features that display information to operators, or accept input from operators. Refer to
Section 14, Communicating with the Operator.
• Security
Features that control file security restrictions and job privileges. Refer to
Section 15, Security.
• System environment expressions
Features that retrieve the current date and time, or information about the system.
Refer to Section 16, Examining the System Environment.

Limitations of WFL
WFL is a specialized language that is not intended for writing general-purpose
applications. In particular, WFL cannot
• Read from or write to files .
• Query or update databases.
• Invoke procedures in libraries.

However, within its specialized purpose, WFL is an exceptionally powerful and flexible
language.

2–4 8807 7391-006


Section 3
Submitting WFL Statements and Jobs

This section explains


• How to submit WFL statements, or jobs from CANDE, MARC, Operations Center or
at an ODT
• How to create and edit WFL jobs in CANDE
• How to use START statement options for various effects

Sources for Submitting WFL Statements or Jobs


You can submit WFL statements or jobs in CANDE, MARC, Operations Center, or at an
ODT. Of these sources,
• CANDE is the easiest to use because CANDE displays a continuous list of all
messages generated by your WFL input. CANDE also includes editing environments
that you can use to create WFL jobs.
• MARC is the second-easiest source to use. It displays some WFL messages on the
screen where you submit the job. However, for other messages from your job, you
must switch to a separate screen called the Task screen. Also, MARC does not
include any tools for editing WFL jobs.
• ODT and Operations Center are advanced interfaces that enable you to monitor all the
processes running on the system. You can submit WFL input from these sources, but
the resulting messages are displayed in the midst of a variety of other messages from
other sources. As a result, it takes some skill to track the progress of a single WFL
statement or job after you submit it. Also, these sources do not include any tools for
editing WFL jobs.

CANDE
The following paragraphs explain how to create and submit WFL statements or jobs in
CANDE. For further information, refer to the CANDE Operations Reference Manual.

Submitting Individual Statements in CANDE


COPY MYDATA/INPUT AS SAVE/MYDATA FROM REFON(PACK) TO UMAST(PACK);

Submits a COPY statement. COPY is one of a small number of WFL statements that
CANDE recognizes directly, as if they were CANDE commands. The WFL statements that
you can enter directly are ADD, ALTER, COPY, PRINT, START, WRAP, and UNWRAP.

8807 7391-006 3–1


Submitting WFL Statements and Jobs

Submitting Multiple Statements in CANDE


WFL MODIFY(JP)OBJECT/EPSILON; PRIORITY = 40; SECURITY
(JP)OBJECT/EPSILON PUBLIC; COPY (JP)OBJECT/EPSILON TO UMAST(PACK);

Submits several WFL statements (MODIFY, SECURITY, and COPY). The WFL keyword
introduces a sequence of WFL statements in CANDE. You must use the WFL keyword if
you are submitting more than one statement, or if you are submitting a statement other
than ADD, COPY, PRINT, or START.

Creating WFL Jobs in CANDE


Start a CANDE session and perform the following steps:
1. Use the MAKE command to create a new file of type JOB.
For example, the following command creates a JOB file titled UTIL/WALCOM:
MAKE UTIL/WALCOM JOB
2. Edit the file in one of the following ways:
• Using the Editor utility.
To invoke the Editor utility, enter the command U ED.
See the Editor Operations Guide for detailed information for using Editor.
At the end of the Editor session, return to CANDE.
• Using CANDE.
Refer to the description of the PAGE command in the CANDE Operations
Reference Manual for more information.
3. Save your work by entering the command SAVE.

Note: Some WFL constructs require you to enter a question mark (?) in column 1. If you
create your WFL job in the Editor, a question mark in column 1 causes the Editor to
interpret your input as a command rather than text. To store question marks in column 1,
you can place an unused character, such as a backslash (\), at the start of lines that need to
begin with a question mark.
Before you save the job, use a REPLACE command to replace all occurrences of your
chosen character with a question mark. For example, to replace all backslashes with
question marks, you can use the following command:
REP ALL .\..?.

Starting WFL Jobs in CANDE


START DB/REPORT ON DEV

Starts the WFL job with the specified file name.

In CANDE, you may have a file open for possible editing. This file is referred to as the
workfile. To start the workfile, simply enter START without specifying a file name.

3–2 8807 7391-006


Submitting WFL Statements and Jobs

For further information about the START statement, refer to Using START Statement
Options later in this section.

Tracking WFL Progress in CANDE


START DBDATA/JOB
#RUNNING 9609
#JOB 9610 IN QUEUE 2
#
#9610 BOJ DBDATA/JOB
#9610\9611 BOT (ICS)OBJECT/DBDATA ON DEV
#9610\9611 EOT (ICS) (ICS)OBJECT/DBDATA ON DEV
#9610\9610 EOJ (ICS) JOB DBDATA/JOB

System messages displayed for a job initiated from CANDE.

Note: CANDE displays WFL messages if the CANDE session option MSG is set. If you
are not seeing these messages, try entering the command SO MSG. This command
affects only the current CANDE session. To set the MSG option permanently, ask your
system administrator to set the CANDEGETMSG attribute for your usercode.

The following are explanations of the individual messages:


• #RUNNING 9609
The WFL compiler is compiling the job.
• #JOB 9610 IN QUEUE 2
The job has been compiled, assigned the mix number 9610, and assigned to job
queue 2. For information about job queues, refer to Section 11, Managing Work
Flow.
• #9610 BOJ DBDATA/JOB
BOJ stands for “Beginning of Job.” The WFL job has been selected from the job
queue and is executing.
• #9610\9611 BOT (ICS)OBJECT/DBDATA ON DEV
BOT stands for “Beginning of Task.” The WFL job has initiated the task
(ICS)OBJECT/DBDATA ON DEV. The task is running with mix number 9611.
• #9610\9611 EOT (ICS) (ICS)OBJECT/DBDATA ON DEV
EOT stands for “End of Task,” and indicates a normal termination of task
(ICS)OBJECT/DBDATA ON DEV. Note that the (ICS) usercode appears twice. The
first usercode shown is the usercode attribute of the task. The second usercode
shown is the usercode of the object code file.
• #9610\9610 EOJ (ICS) JOB DBDATA/JOB
EOJ stands for “End of Job,” and indicates a normal termination of the WFL job.

8807 7391-006 3–3


Submitting WFL Statements and Jobs

MARC
The following paragraphs explain how to create and submit WFL statements or jobs in
MARC. For further information, refer to the Menu-Assisted Resource Control (MARC)
Operations Guide.

Using the Action Field


Submits a MODIFY statement in the Action field. You must precede your statements with
the prefix WFL. You can use the Action field in this way only if COmnd is displayed as one
of the screen action hints on line 3.

Using the COMND Screen


Submits a series of statements on the COMND screen. The advantage of using the
COMND screen is that it provides a much longer entry field than the Action field. To reach
the COMND screen, enter CO in the Action field of a screen that includes COmnd as one
of the screen action hints displayed on line three.

Submitting Individual Statements in MARC


START DBDATA/JOB
#RUNNING 9609
#JOB 9610 IN QUEUE 2
#
#9610 BOJ DBDATA/JOB
#9610\9611 BOT (ICS)OBJECT/DBDATA ON DEV
#9610\9611 EOT (ICS) (ICS)OBJECT/DBDATA ON DEV
#9610\9610 EOJ (ICS) JOB DBDATA/JOB

Submits a COPY statement. COPY is one of a small number of WFL statements that
MARC recognizes directly, as if they were MARC commands. The WFL statements that
you can enter directly are ADD, COPY, and START.

Submitting Multiple Statements in MARC


WFL MODIFY (JP)OBJECT/EPSILON; PRIORITY = 40; SECURITY
(JP)OBJECT/EPSILON PUBLIC; COPY (JP)OBJECT/EPSILON TO UMAST(PACK);

Submits several WFL statements (MODIFY, SECURITY, and COPY). The WFL keyword
introduces a sequence of WFL statements in MARC. You must use the WFL keyword if
you a submitting more than one statement, or if you are submitting a statement other than
ADD, COPY, or START.

Starting WFL Jobs in MARC


START DBDATA/JOB ON DEV

Starts the WFL job with the specified file name.

3–4 8807 7391-006


Submitting WFL Statements and Jobs

For further information about the START statement, refer to Using START Statement
Options later in this section.

Tracking WFL Progress in MARC


Notification of Job Initiation and Termination

The COMND screen, as it appears immediately after you have started a WFL job. To see
the job messages, you must transmit the Task command in the Action field.

If you do not use the Task command, then when the WFL job terminates, the message at
the bottom of the COMND screen typically changes to
No task message received for task.

Viewing Job Messages

The TASKSTATUS screen, which displays messages for the job. Following are
explanations of the individual messages:
• 15:08 697\ 758 BOT (ICS)"MARC WFL"
The WFL compiler is compiling the job.
• 15:08 Job 759 has been placed in system queue 2
The job has been compiled, assigned the mix number 759, and assigned to job
queue 2. For information about job queues, refer to Section 11, Managing Work
Flow.
• 15:08 0697\ 758 EOT (ICS) (ICS)MARC WFL
The WFL compiler has terminated.
• 15:08 759\ 759 BOJ DBDATA/JOB
BOJ stands for “Beginning of Job.” The WFL job has been selected from the job
queue and is executing.
• 15:08 759\ 760 BOT (ICS)OBJECT/DBDATA ON DEV
BOT stands for “Beginning of Task.” The WFL job has initiated the task
(ICS)OBJECT/DBDATA ON DEV. The task is running with mix number 760.
• 15:08 0759\ 760 EOT (ICS) (ICS)OBJECT/DBDATA ON DEV
EOT stands for “End of Task,” and indicates a normal termination of task
(ICS)OBJECT/DBDATA ON DEV. Note that the (ICS) usercode appears twice. The
first usercode shown is the usercode attribute of the task. The second usercode
shown is the usercode of the object code file.
• 15:08 0759\ 759 EOJ (ICS) JOB DBDATA/JOB
EOJ stands for “End of Job,” and indicates a normal termination of the WFL job.

8807 7391-006 3–5


Submitting WFL Statements and Jobs

ODT
The following topics explain how to create and submit WFL statements or jobs at an ODT.
For further information about operating the system at an ODT, refer to the following
documents:
• System Operations Guide
• System Commands Reference

Submitting Individual Statements at an ODT


COPY (JP)MYDATA/INPUT AS (JP)SAVE/MYDATA FROM REFON(PACK) TO
UMAST(PACK);

Submits a COPY statement. COPY is one of a number of WFL statements that an ODT
recognizes directly, as if they were system commands. The WFL statements that you can
enter directly include ADD, COPY, and REMOVE, among others.

If you’re not sure whether a given statement requires the BEGIN JOB prefix, simply
include the prefix anyway. The prefix never causes a problem.

Submitting Multiple Statements at an ODT


BEGIN JOB; MODIFY (JP)OBJECT/EPSILON; PRIORITY = 40; SECURITY
OBJECT/EPSILON PUBLIC; COPY (JP)OBJECT/EPSILON TO UMAST(PACK);

Submits several WFL statements. The phrase BEGIN JOB; indicates that the input is WFL
statements rather than system commands.

Alternatively, you can begin the job with the letters CC or a question mark (?) rather than
BEGIN JOB.

Starting WFL Jobs at an ODT


START (OPS)DB/REPORT ON DEV

Starts the WFL job with the specified file name.

For further information about the START statement, refer to Using START Statement
Options later in this section.

Tracking WFL Progress at an ODT


Display of an ODT screen immediately after you have submitted a START command. This
ODT is running in automatic display mode (ADM). The screen is divided into categories of
information that are automatically updated every few seconds. The exact categories can
vary, depending on how ADM is configured. This example shows the default categories.

In this example, the job DBDATA/JOB has become suspended, and therefore appears in
the Waiting Entries display.

3–6 8807 7391-006


Submitting WFL Statements and Jobs

Job Name

If the WFL job is compiled successfully, you will see no immediate indication of the mix
number for the job. Therefore, you must use the job name to locate the job in the ADM
display. Remember, however, that the job name can be different than the file title of the
job. The job name is specified within the job itself, immediately after the BEGIN JOB
phrase. Refer to Specifying a Job Name in Section 4, Job Structure.

If the WFL job does not include a job name, or you submitted WFL statements rather than
a job, then look for entries named JOB ″BEGIN JOB; <text>″, where <text> consists of
the first few characters of the WFL statements.

Using an ODT Display

You can track the progress of your job by using various portions of an ODT display as
follows:

To . . . Do this:

Determine whether there were syntax errors If there were syntax errors, a message
in your WFL statements. displays that includes details of the first syntax
error; for example:
03373 Control card error
00000300 I := J;
*
UNDECLARED IDENTIFIER
Additionally, the job appears in the Completed
Entries display with the word SNTX in the Hist
column. The system also produces a job
summary printout.
If there were no syntax errors, the job appears
in one of the other parts of an ODT display,
such as Active Entries, Waiting Entries, or
Scheduled Entries.

Determine whether the job is in a job queue From the home position, enter the command
SQ to display the contents of all job queues, or
SQ <number> to display the contents of a
single job queue.
Determine the current mix number of the WFL Examine the Active Entries display for entries
job. with the job name. Make a note of the number
displayed in the Mix column of the same line.

Determine whether the job has displayed Examine the Messages display for entries
messages. with the mix number of your WFL job. The text
of the message appears in the Display column.

Determine whether job initiation has been Examine the Scheduled Entries display for an
delayed by the system entry with the name and mix number of your
WFL job.

8807 7391-006 3–7


Submitting WFL Statements and Jobs

To . . . Do this:

Determine whether the job is suspended Examine the Waiting Entries display for an
entry with the name and mix number of your
WFL job.

Determine whether the job is completed Examine the Completed Entries display for
entries with the name and mix number of your
WFL job. If such an entry is present, the job
has completed.

Operations Center
If you are using a workstation on a ClearPath MCP Server, you might have access to the
Operations Center utility. This utility provides a graphical interface to system operations. If
Operations Center is available on your workstation, then the Operations Center utility
appears in the Unisys MCP program folder.

For detailed information about Operations Center, refer to the Operations Center Help.

Submitting WFL Statements and Jobs in the Operations


Center
Do the following to submit WFL statements or jobs in Operations Center:,
1. Click Tools and select Enter a System Command.
The Enter a System Command dialog box appears.
2. In the System Command box, type one of the following:
• A WFL statement that does not require a prefix.
These statements include COMPILE, COPY, PROCESS, RERUN, and RUN.
• The prefix BEGIN JOB; or CC, followed by one or more WFL statements.
• A START statement that initiates a complete WFL job.
For more information about the START statement, refer to Using START
Statement Options later in this section.
3. Press Enter.
The message Null Response appears in the Response box.

Tracking WFL Progress in the Operations Center


Operations Center provides sub windows called views. These views serve the same
purpose as ADM at an ODT; that is, they display categories of information that are updated
every few seconds. You can track the progress of your job in much the same manner
previously described under “Tracking WFL Progress at an ODT.”

3–8 8807 7391-006


Submitting WFL Statements and Jobs

Using START Statement Options


START is the statement for initiating WFL jobs. You can enter the START statement in any
of the interfaces discussed earlier in this section: CANDE, MARC, ODT, and Operations
Center.

The START command causes the system to compile the job and display syntax errors, if
any. If there are no errors, the system typically places the job in a job queue. Job queues
are discussed in Section 11, Managing Work Flow. When the job reaches the front of the
job queue, the system selects the job and executes it.

The following pages discuss START statement options that enable you to
• Start a job immediately.
• Start a job with parameters.
• Start a job with optional parameters.
• Start a job for syntax checking only.
• Start a job at a specific time.
• Start a job from another WFL job.
• Start another copy of the same WFL job.

Starting a Job Immediately


START RECON/DATA

Starts the job named RECON/DATA.

Starting a Job with Parameters


START YORK/ULIB (TRUE, 6, 5.3, "DIAG")

Passes several types of parameters to a job. A parameter is a piece of information that the
job can read into a variable. The value of a parameter can change the way the job runs. For
more information about job parameters, refer to Section 14, Communicating with the
Operator.

You can include one or more spaces between each parameter. However, these spaces are
not required.

Starting a Job with Optional Parameters


Using Commas as Placeholders
START YORK/ULIB (,,,"DIAG")

Passes only the fourth parameter to a job that accepts four optional parameters. In this
example, the fourth parameter is a string parameter. The three commas indicate that the
first three parameters are omitted.

8807 7391-006 3–9


Submitting WFL Statements and Jobs

Using Named Parameters


START YORK/ULIB (RMODE := "DIAG")

Passes only the parameter named RMODE to a job that accepts optional parameters. The
RMODE := phrase indicates which one of the optional parameters should receive the
specified value.

For Further Information

For more information about optional job parameters, refer to Section 13, Working with
Data.

Starting a Job for Syntax Checking Only


START ADREP/UCON SYNTAX

Compiles the job ADREP/UCOM and displays messages indicating if there are any syntax
errors. However, the SYNTAX option keeps the job from actually being executed, even if it
compiles without error.

If you use the SYNTAX option, you do not need to include any job parameters, even if the
job would normally require them.

Starting a Job at a Specific Time


START ADFAB/FILECON; STARTTIME = 17:00

Compiles a job and places the job in a job queue. The system does not select the job from
the job queue for execution until at least 5:00 PM.

For further examples using the STARTTIME option, refer to Selecting a Start Time in
Section 11, Managing Work Flow.

Starting a Job from Another WFL Job


BEGIN JOB RUNNIT;
RUN OBJECT/RECS;
START (JAS)CLEANUP/JOB ON MUPACK;
END JOB

Runs a program and then uses a START statement to initiate another WFL job.

The START statement in a WFL job can also include the various options that have been
described previously, such as the SYNTAX option, STARTTIME option, and job parameters.

The START AND WAIT statement initiates a second job as a dependent task within a WFL
job and waits for the dependent task to complete.

3–10 8807 7391-006


Submitting WFL Statements and Jobs

Starting Another Copy of the Same WFL Job


You might have WFL jobs that need to run on a regular basis. For such jobs, you can
include a START statement that restarts the job at a later date or time. For examples, refer
to Running a Job on Regular Basis in Section 11, Managing Work Flow.

8807 7391-006 3–11


Submitting WFL Statements and Jobs

3–12 8807 7391-006


Section 4
Job Structure

The basic structure of WFL jobs is both simple and flexible. This section introduces the
basic elements of WFL jobs, including
• Overall structure
• Job titles
• Formatting and casing
• Comments
• Statements included from another file

Overall Structure
BEGIN JOB;
<statements>;
END OF JOB

WFL jobs begin with the phrase BEGIN JOB and end with the phrase END JOB. In
between, you can include as many statements as you want.

Specifying a Job Name


BEGIN JOB <job name>:
<statements>;
END JOB

It is a good idea to include a job name after the BEGIN JOB phrase. The job name that you
choose will appear in system messages and log entries relating to the job. It is helpful to
make the job name the same as the name of the file that stores the job. That way,
someone who sees messages or log entries relating to the job will find it easier to locate
the file containing the job.

Some Simple Jobs


The following topics provide examples of simple WFL jobs.

8807 7391-006 4–1


Job Structure

Running a Task
BEGIN JOB RUNHEADERS;
RUN OBJECT/UTIL/NOTEHEADERS;
END JOB

This job runs a program called OBJECT/UTIL/NOTEHEADERS. For more information about
running tasks, refer to Section 5, Running Tasks.

Compiling a Program
BEGIN JOB COMPILEPROG;
COMPILE (JONES)OBJECT/GEN/REPORT WITH ALGOL LIBRARY;
COMPILER FILE CARD(TITLE=(JONES)GEN/REPORT ON MYPACK);
END JOB

This job compiles an ALGOL program from the source file (JONES)GEN/REPORT ON
MYPACK. The compilation creates an object code file called
(JONES)OBJECT/GEN/REPORT.

This job includes a single statement that extends over two lines. The line beginning
COMPILER FILE CARD is considered to be part of the COMPILE statement.

For more information about compiling programs, refer to Section 10, Compiling Programs.

Copying Files
BEGIN JOB COPYFEB;
COPY DATA/FEB AS ARCHIVE/DATA/FEB
FROM RFPACK(PACK) TO RECON(PACK);
END JOB

This job copies the file DATA/FEB from the disk family RFPACK to the disk family RECON.
The copy is created with the name ARCHIVE/DATA/FEB. For more information about
copying files, refer to Section 7, Copying Files.

Using Multiple Statements


BEGIN JOB RUNHEADERS;
RUN OBJECT/UTIL/NOTEHEADERS;
COMPILE (JONES)OBJECT/ALGOL/TEST WITH ALGOL LIBRARY;
COMPILER FILE CARD(TITLE=ALGOL/TEST ON MYPACK);
COPY DATA/FEB AS ARCHIVE/DATA/FEB
FROM RFPACK(PACK) TO RECON(PACK);
END JOB

This example combines three statements from the previous jobs into a single job.

4–2 8807 7391-006


Job Structure

Formatting and Casing

General Rules
Format your job according to the following rules:
• WFL input is not case-sensitive; keywords and variables can be in uppercase,
lowercase, or mixed case. However, if the security option CASESENSITIVEPW option
is set, unquoted passwords are case-sensitive.
• Each statement must end with a semicolon (;). A question mark (?) in column one is
treated as a semicolon. However, semicolons can also occur in the middle of some
statements.

These are statements that include task or file equations. The main part of the statement
ends with a semicolon, and each task or file equation also ends with a semicolon. An
example of such a statement is given under Compiling a Program earlier in this section.
• Most statements can start in any column.
• The number of blank spaces between words can vary.
• A single statement can continue across multiple lines. Multiple statements can
appear on a single line, as long as they are separated by semicolons.
• Indenting can make the structure of the job more obvious to anyone who is reading
the job.

Formatting Example
BEGIN JOB DAILYTOTALS;
COPY DAILY/TOTALS FROM DBCOM(PACK) TO ARCH(PACK);
IF TIMEDATE(DAY) = "SUNDAY" THEN
BEGIN
RUN OBJECT/WEEKTOTALS;
RUN OBJECT/RELAY;
END;
END JOB

In this job, the COPY statement and the IF statement are indented the same amount,
because both statements are on the same level and are executed one after the other.

However, the BEGIN . . . END pair is indented to emphasize that it is part of the IF
statement. The RUN statements are indented to emphasize that they are grouped within
the BEGIN . . . END pair.

This use of indentation makes the overall structure of the job statement easier to read. For
more information about the IF statement and similar statements, refer to Section 12, Flow
of Control.

8807 7391-006 4–3


Job Structure

Adding Comments
% Job: DAILYTOTALS
% Author: Jennifer Chang, extension 6574
% This Version: June 3, 2001
% The DAILYTOTALS job runs payroll tasks for the
% Accounting department.
BEGIN JOB DAILYTOTALS;
IF TIMEDATE(DAY) = "SUNDAY" THEN
RUN OBJECT/WEEKTOTALS;
ELSE
BEGIN
RUN OBJECT/DAILYTOTALS;
RUN OBJECT/RELAY; % Forwards data to site SFCP1
END;
END JOB

Includes comments to explain the purpose and behavior of the job.

Comments are not executed, nor are they displayed to the user. They are only visible to
someone who is reading the source file for your job. Comments help other programmers
to understand how to update or improve your job. Comments also remind you why you
designed the job in a certain way.

The percent sign (%) indicates the start of a comment. A comment can appear on a line by
itself, or it can appear after a WFL statement. Comments can include both uppercase and
lowercase letters, numbers, spaces, and punctuation marks.

Including Statements from Another File

Sharing Statements among Jobs


You can use the $INCLUDE option to insert text from another file into a job. The text must
consist of WFL statements, or portions of statements, that are valid in the context where
the $INCLUDE option occurs.

The $INCLUDE option is especially convenient for cases where you want the same
statements to appear in multiple WFL jobs. You can write the shared statements in one
file and use $INCLUDE option in each WFL job that uses those shared statements. Then,
if you need to make changes to the shared statements, you only have to make the
changes in one place.

Note: Unlike most WFL statements, the $INCLUDE option cannot be indented. The
dollar sign ($) must occur in column one or two.

4–4 8807 7391-006


Job Structure

Including Complete Files


BEGIN JOB RUNCUSTOM(STRING PARAMSTR);
$INCLUDE (OPS)WFL/ROUTINES ON DEV;
STRING PARAMBUF;
PARAMBUF := PARAMSTR;
UPCASE(PARAMBUF);
RUN *OBJECT/PAYROLL ON ACCT(PARAMBUF);
END JOB

Includes the file (OPS)WFL/ROUTINES ON DEV near the beginning of a job. In this case,
the included file contains a collection of useful subroutines, including one called UPCASE.

Including Portions of Files


BEGIN JOB BACKUP/PDQDB;
RUN *SYSTEM/DMUTILITY ("DB=*PDQ ON DBFAM OPTIONS" &
"(WORKERS=2), DUMP TO DMS01B(TAPES=2," &
$INCLUDE (OPS)BACKUP/TAPENUMBERS ON DEV 10000 TO 10500;
& ", DENSITY=BPI38000)") [T1];
END JOB

Includes a selected range of records from the file (OPS)BACKUP/TAPENUMBERS ON


DEV. The records are specified by their sequence numbers, which in this case are in the
range 10000 to 10500.

Note that the inserted text occurs in the middle of a parameter to the RUN statement. In
this example, the file (OPS)BACKUP/TAPENUMBERS must contain text that can form a
valid part of a parameter to the program being run.

Other Structures
WFL jobs can include a number of other optional structures. These are described later in
the book in the following places:

Structure Where Discussed

Job attribute list Section 11, Managing Work Flow

Job parameters Section 13, Working with Data

Declarations of variables Section 13, Working with Data


Subroutines Section 12, Flow of Control

8807 7391-006 4–5


Job Structure

4–6 8807 7391-006


Section 5
Running Tasks

This section explains the following topics related to initiating and controlling tasks:
• What is a task?
• Using the RUN statement
• Preventing accidental task restarts
• Controlling file usage
• Using task equations
• Using task variables
• Handling task terminations
• Running tasks in parallel
• Passing parameters to a task

What Is a Task?
When you run a program from WFL, the system creates something called a task. A task is
a single copy of a program that is executing in system memory. If you run the same
program several times, you create a new task each time.

For a more detailed explanation of tasking concepts, refer to the Task Management
Programming Guide.

Using the RUN Statement


BEGIN JOB;
RUN (WESLEY)OBJECT/ALTCOM ON SERV;
END JOB

Runs the program (WESLEY)OBJECT/ALTCOM ON SERV.

Key points to remember about the RUN statement:


• The RUN statement can initiate programs written in almost any programming
language (ALGOL, C, COBOL, and so on).
• However, the RUN statement cannot initiate another WFL job; you must use the
START statement for that purpose. Refer to Starting a Job from Another WFL Job in
Section 3, Submitting WFL Statements and Jobs.

8807 7391-006 5–1


Running Tasks

• The RUN statement must specify the name of the object code file for a program. The
object code file is the compiled version of the program. By contrast, the source code
file stores the program as it was originally written by the programmer. Object code
files often have titles beginning with OBJECT or SYSTEM. (For information about
compiling programs, refer to Section 10, Compiling Programs.)

Preventing Accidental Task Restarts


BEGIN JOB;
ON RESTART,
ABORT "Aborting job because of automatic restart";
RUN OBJECT/PAYROLL;
END JOB

Runs the program OBJECT/PAYROLL no more than once. If the system restarts the job
after a halt/load, the ON RESTART statement invokes an ABORT statement to terminate
the job.

Rules

The ON RESTART statement is related to the automatic restart feature of WFL jobs. The
system automatically restarts any WFL job that is interrupted by a halt/load. This automatic
restart feature is helpful, provided that your job and its tasks are designed with possible
restarts in mind. For information about how to design a job for restarts, refer to
Section 17, Designing Jobs for Restarts.

At this point, all you need to know is that automatic restarts can occur if you do not take
steps to prevent them. For example, suppose that your WFL job runs a task that prints
paychecks. If a halt/load occurs while the task is running, then after the halt/load, the job is
restarted and runs the task again. The result could be that some paychecks are printed
twice.

If your WFL job runs tasks that should not be restarted, you can use an ON RESTART
statement such as the one in the preceding example. The ON RESTART statement
specifies actions to be taken if the job is restarted after a halt/load.

The ON RESTART statement is executed when


• A halt/load occurs.
• The <mixno> RESTART command is included in a job.

Controlling File Usage


When you run a program from WFL, you can control what files the program uses and
change the way that program uses files. You can
• Use file equations to specify the attributes of files used by the program.
• Use data specifications to supply input data for a program.
• Use task attributes to ensure that the program can successfully open a remote file.

5–2 8807 7391-006


Running Tasks

Using File Equations


RUN (WESLEY)OBJECT/ALTCOM ON SERV;
FILE INPUT(KIND=DISK,TITLE=(CHEN)COMDATA/INPUT);
FILE RELCON(TITLE=(CHEN)COMDATA/RELCON ON LBFAM);

Runs a program, and uses file equations for two files used by the program.

FILE

A keyword indicating the start of a file equation.

INPUT and RELCON

Internal names of files used by the program. These names vary from one program to
another.

Note: To find out the internal names of files for a program, you must examine
documentation for the program, talk to the person who created the program, or examine
the source file for the program.
The internal name is usually the same as the identifier specified in the file declaration. For
example, suppose a file is declared in the source file as FILE ABFAB (KIND=DISK,
TITLE=”DATA/INPUT/CFORM ON UFAM”). In this example, the internal name is ABFAB.
If the INTNAME attribute is specified, it overrides this default and specifies a different
internal name. The INTNAME is the first 17 characters of the filename specified in the
program. The first 17 characters should be unique.

KIND

A file attribute that specifies the type of medium on which the file resides. Possible values
include DISK, TAPE, CD, PRINTER, and REMOTE, among others. By assigning a KIND
value, you can do things such as making a program write to disk instead of tape.

TITLE

A file attribute that specifies the title of the file. Note that the TITLE assignment for FILE
RELCON includes an ON <family> part. This ON <family> part has the side effect of
changing the KIND attribute to DISK.

Rules

File equations immediately follow the RUN statement for the program. Preceding file
equations do not affect the program. File equations for subsequent programs also do not
affect the program.

You can specify as many file attributes as you like for each file. For a complete description
of all the file attributes that are available, refer to the File Attributes Programming
Reference Manual.

8807 7391-006 5–3


Running Tasks

Using Data Specifications


You can use data specifications to supply input data to a program. The specification takes
the place of an input file that the program would have otherwise used.

For Programs That Expect Card Reader Input


RUN (REC)OBJECT/CRPROC;
DATA
PAY CODE 153
WEEKLY REPORT
STOCK FORMAT
?

Runs a program and provides input data for that program. When the program opens any
card reader file and reads from it, the READ statements will actually read data from the
data specification.

DATA

Indicates the start of a data specification.

Terminates the data specification. Must be located in column 1.

For Programs That Read from Other Kinds of Files


RUN (REC)OBJECT/DKPROC;
FILE CONTROL(KIND=READER);
DATA
PAY CODE 153
WEEKLY REPORT
STOCK FORMAT
?

The program (REC)OBJECT/DKPROC is designed to read input from a disk file with the
internal name CONTROL. The file equation changes the KIND value of the CONTROL file
to READER, which indicates a card reader file. Because the KIND value is now READER,
the program automatically reads from the data specification following the RUN statement.

Note: Some programs might fail or run abnormally if you equate a file to READER. For
example, because READER files are read-only, an error occurs if the program attempts to
write to the file.

5–4 8807 7391-006


Running Tasks

For Programs That Read from Multiple Files


RUN (REC)OBJECT/DKPROC;
FILE CONTROL(KIND=READER);
FILE TRANS(KIND=READER);
DATA CONTROL
PAY CODE 153
WEEKLY REPORT
STOCK FORMAT
?
DATA TRANS
AUDIT MODE ENABLED
TRANSACTION TRACE
?

Supplies data specifications for two different input files. In this example, each data
specification is named to specify the corresponding input file.

The names are optional. Whenever the program tries to open a card reader file, the
system opens the first unread data specification with the correct name or no name. By
using names, you make your WFL job clearer and more reliable. It is especially important
to name the data specifications if you do not know which file the program opens first.

For Compilations
Data specifications are often used to supply options for compilations. For examples of this
usage, refer to Section 10, Compiling Programs.

Using Remote Files


Rationale

A remote file is a file that a program uses to read or display information at a terminal.
Usually, the program opens the remote file at the terminal where the program was
initiated. Some programs that open remote files were originally designed to be run from
MARC or CANDE. These programs depend on certain defaults that are supplied by MARC
and CANDE. If such programs are initiated from a WFL job, they might fail with the error
UNKNOWN FILE/STATION

Example
BEGIN JOB;
% <Declarations, if any>
MYJOB(STATIONNAME = #MYJOB(SOURCENAME));
RUN OBJECT/P;
END JOB

Runs OBJECT/P in such a way that OBJECT/P will be able to open remote files.

8807 7391-006 5–5


Running Tasks

Rules

The STATIONNAME assignment must come after any declarations in the WFL job, but
typically should come before any statements in the job. (A declaration defines a variable,
file, or subroutine.) For more information about declarations, refer to Section 13, Working
with Data.

Using Task Equations


Each task has a number of properties that are referred to as task attributes. There are
more than a hundred task attributes, and each task has all these attributes. Each task
attribute has a range of two or more possible values. Task attributes control many aspects
of task execution, such as the priority, usercode, and default disk families for the task. For
a complete description of task attributes, refer to the Task Attributes Programming
Reference Manual.

When you initiate a task, you can append task equations to the RUN statement. These
task equations assign values to task attributes. The following topics describe some
common types of task equations.

Equating the Usercode


RUN OBJECT/DBDATA;
USERCODE = GARETH / ONEFARM;

You must include a usercode and a password in the assignment. In this example, GARETH
is the usercode and ONEFARM is the password.

If you do not assign a usercode to a task, the task inherits the usercode of the WFL job.

The usercode of a task can affect the task in a number of ways, including task privileges,
file usercodes, and file families.

Usercode: Effect on Task Privileges


A usercode can have any of several types of privileges. Certain actions can be performed
only by a task with the appropriate privileges. For further information, refer to
Section 15, Security.

Usercode: Effect on File Usercodes


If the task opens an existing disk file without specifying the usercode of the file, the
system searches for the file first under the usercode of the task, and second under the null
(*) usercode.

If the task creates a new disk file without specifying the file usercode, the system creates
the file with the same usercode as the task.

5–6 8807 7391-006


Running Tasks

Usercode: Effect on File Families


If your system administrator defined a FAMILY statement for your usercode, that becomes
the default FAMILY statement for all tasks run under your usercode. You can change the
value for a specific task as described under Equating the Family Statement later in this
section.

Equating the Priority


RUN OBJECT/DBDATA;
PRIORITY = 65;

The priority of a task affects how quickly the task executes. The possible PRIORITY values
range from 0 to 99, with 50 as the default. A high priority tends to make the task run
faster, but can have the side effect of slowing down other tasks on the system.

Equating the Family Statement


FAMILY <target family> = <primary family> OTHERWISE <alternate family>;
FAMILY <target family> = <primary family> ONLY;

The family statement helps determine the disk families that a task uses for disk files. The
family statement has one of the two forms shown above.

The effect of a family statement is to cause the primary family to be used whenever the
target family would have otherwise have been used. If the file cannot be found on the
primary family, then in some cases the system uses the alternate family instead.

Example: Primary and Alternate Families


RUN OBJECT/DBDATA;
FAMILY DISK = SERV OTHERWISE DEV;

The following are the effects of this family statement on various actions performed by
OBJECT/DBDATA:

Action File Title Result

Create a new disk ACCT/DATA or ACCT/DATA File is created on SERV.


file ON DISK

ACCT/DATA ON UFAM File is created on UFAM.


Open an existing ACCT/DATA or ACCT/DATA File is opened on SERV, if file is present;
disk file ON DISK otherwise, is opened on DEV, if file is
present; otherwise, file open waits or fails.
ACCT/DATA ON UFAM File is opened on UFAM, if file is present;
otherwise, file open waits or fails.

8807 7391-006 5–7


Running Tasks

Example: Primary Family Only


RUN OBJECT/DBDATA;
FAMILY DISK = SERV ONLY;

The following are the effects of this family statement on various actions performed by
OBJECT/DBDATA. Differences from the preceding table are bolded.

Action File Title Result

Create a new disk ACCT/DATA or ACCT/DATA File is created on SERV.


file ON DISK
ACCT/DATA ON UFAM File is created on UFAM.

Open an existing ACCT/DATA or ACCT/DATA File is opened on SERV, if file is present;


disk file ON DISK otherwise, file open waits or fails.
ACCT/DATA ON UFAM File is opened on UFAM, if file is present;
otherwise, file open fails.

Example: Target Family Other Than DISK


RUN OBJECT/DBDATA;
FAMILY UFAM = DEV ONLY;

The following are the effects of this family statement on various actions performed by
OBJECT/DBDATA. Differences from the preceding table are bolded.

Action File Title Result

Create a new disk ACCT/DATA or ACCT/DATA File is created on DISK.


file ON DISK

ACCT/DATA ON UFAM File is created on DEV.

Open an existing ACCT/DATA or ACCT/DATA File is opened on DISK, if file is present;


disk file ON DISK otherwise, file open waits or fails.

ACCT/DATA ON UFAM File is opened on DEV, if file is present;


otherwise, file open waits or fails.

Using Task Variables


You can use task variables to read or write task attributes. (By contrast, you can use task
equations to assign task attributes but not to read them.)

5–8 8807 7391-006


Running Tasks

Declaring, Assigning, and Reading Task Variables


BEGIN JOB TVARDEMO (BOOLEAN DIAG);
TASK T(PRIORITY = 55, USERCODE = JAMES/PW,
FAMILY DISK = DISK ONLY);
IF DIAG THEN
T(SW1 = TRUE);
RUN (PARTS)OBJECT/PROG [T];
IF T(TASKVALUE) NEQ 0 THEN
DISPLAY "ERROR IN SUMMARY RUN";
END JOB

This example uses task variable T in the following ways:


• TASK T...
Declares the task variable and assigns values to the PRIORITY, USERCODE, and
FAMILY task attributes.
• T(SW1 = TRUE)
Assigns a value to the SW1 task attribute of task variable T.
• [T]
Assigns the task variable to this execution of the program OBJECT/PROG. As a result,
OBJECT/PROG runs with the task attributes that were previously assigned to T.
• T(TASKVALUE) NEQ 0
Checks the value of the TASKVALUE task attribute of task variable T. The NEQ
operator means “not equal to.” In this example, it is assumed that OBJECT/PROG
sets its own TASKVALUE to a nonzero value if an error occurs.

Reading Various Types of Task Attributes


BOOLEAN BVAL;
INTEGER IVAL;
REAL RVAL;
STRING SVAL1, SVAL2, SVAL3;
TASK T;
RUN OBJECT/DTTRANS [T];
BVAL := T(SW1);
IVAL := T(MIXNUMBER);
RVAL := T(TASKVALUE);
SVAL := T(HISTORYCAUSE);
SVAL := T(TASKSTRING);
SVAL := T(FAMILY);

Reads the value of several task attributes after a task completes. You simply assign the
task attribute to a variable of the correct type. To determine the data type of a particular
task attribute, refer to the Task Attributes Programming Reference Manual.

The FAMILY task attribute returns a string with a fairly complex form. For information
about extracting information from this string, refer to “Parsing a FAMILY Task Attribute” in
Section 13, Working with Data.

8807 7391-006 5–9


Running Tasks

Reusing Task Variables


Unexpected side effects can result from reusing a task variable. You can prevent these
problems by reinitializing the task variable before each use.

Bad Reuse of a Task Variable


% Incorrect Example:
BEGIN JOB
TASK T(FILE CARD(KIND=DISK,TITLE=INPUT1));
RUN SYSTEM/CARDLINE [T];
FILE LINE(KIND = DISK);
RUN SYSTEM/CARDLINE [T];
END JOB

This job declares task variable T and assigns it to each of two different tasks. This
technique might seem convenient at first. For example, the FILE CARD equation in the
task declaration affects both tasks. Thus, by reusing the task variable, you save having to
retype the FILE CARD equation.

However, the FILE LINE equation in the first RUN statement gets saved as part of T.
Because the second RUN statement reuses T, the FILE LINE equation also gets applied to
the second task. This is one example of the type of unexpected side effects that result
from reusing task variables.

Reinitializing a Task Variable


BEGIN JOB
TASK T;
RUN SYSTEM/CARDLINE [T];
FILE CARD(KIND=DISK,TITLE=INPUT1);
FILE LINE(KIND = DISK);
INITIALIZE (T);
RUN SYSTEM/CARDLINE [T];
FILE CARD(KIND=DISK,TITLE=INPUT1);
END JOB

This job uses the INITIALIZE statement to prevent side effects. This statement restores all
the attributes of a task variable to their defaults.

Using MYJOB
BEGIN JOB;
IF MYJOB(USERCODE) NEQ "OPSECT" THEN
STOP "MUST BE RUN UNDER OPSECT USERCODE";
RUN OBJECT/P;
END JOB

Reads the usercode of the job and stops the job if it was not initiated under the correct
usercode.

5–10 8807 7391-006


Running Tasks

Rules

MYJOB is a task variable with a predefined meaning. MYJOB always refers to the task
attributes of the WFL job.

Handling Task Terminations


You can design a job to take special actions if a task does not complete successfully.

Checking Whether a Task Completed Successfully


BEGIN JOB RUNPA;
TASK PA1;
STRING JUNK;

RUN OBJECT/PA [PA1];


IF PA1 ISNT COMPLETEDOK THEN
BEGIN
JUNK := ACCEPT ("PA failed. Notify PA administrator.");
END;
END JOB

Runs a task and displays a message if the task fails.

ISNT COMPLETEDOK

The following is an example of the task state expression, which has one of the following
forms:
<task variable> IS <task state>

<task variable> ISNT <task state>

One or more of the following task states are true after a task terminates:
• ABORTED
The task faulted or was discontinued.
• COMPLETEDOK
The task completed without faulting or being discontinued.
• COMPILEDOK
(Applies only to compilations.) The compiler finished normally and did not find any
syntax errors. If a compilation is COMPLETEDOK but is not COMPILEDOK, then the
compiler finished normally but found syntax errors.
• ACCEPT
Suspends the job. The job appears in the W (Waiting Entries) display with the
message PA failed. Notify PA administrator. The job remains there until an operator
enters a command of the form <mix number> AX.

8807 7391-006 5–11


Running Tasks

Aborting the Job if a Task Fails


BEGIN JOB PAYROLL/SEQUENCE;
TASK T;
RUN OBJECT/PR [T];
IF T ISNT COMPLETEDOK THEN
ABORT "OBJECT/PR FAILED";
RUN OBJECT/PR/REFORMAT [T];
IF T ISNT COMPLETEDOK THEN
ABORT "OBJECT/PR/REFORMAT FAILED";
RUN OBJECT/PR/REPORT [T];
END JOB

Runs three tasks. Aborts the job immediately if any task in the series fails.

ABORT <string value>;

Terminates the job. The system displays the string value and then displays a PDS
message. Both the string value and the PDS message are also written to the system log.

An alternative to the ABORT statement is the STOP statement. Refer to Section 12, Flow
of Control.

Retrying a Task Until It Succeeds


BEGIN JOB TEST/WFL;
TASK T1, T2;
DO
BEGIN
INITIALIZE (T1);
RUN OBJECT/PR/RECOVER [T1];
END
UNTIL T1 IS COMPLETEDOK;
DO
BEGIN
INITIALIZE (T2);
RUN OBJECT/PR/SUMMARY [T2];
END
UNTIL T2 IS COMPLETEDOK;
END JOB

Runs two programs. Retries each program if it fails.

DO . . . UNTIL

The DO statement is a type of loop. That is, the DO statement repeats an action until a
given condition is true. For more information about the DO statement, refer to
Section 12, Flow of Control.

5–12 8807 7391-006


Running Tasks

<task variable> IS COMPLETEDOK

This condition evaluates to TRUE only if the task terminates normally.

Caution
Retrying a task might not always be desirable, for the following reasons:
• If the task failed because of an internal fault, the task might continue
to fail each time it is run.
• If the task was discontinued by an operator, the operator might have some
reason for not wanting the task to be restarted.
• If the task is not designed with retries in mind, it might corrupt data when
it is run again. For example, a program that makes deposits to accounts
might deposit the same money to the same account a second time.

Retrying a Task if Operator Approves


BEGIN JOB TEST/WFL;

TASK T;
BOOLEAN DONE;
STRING RESPONSE;

DONE := FALSE;
DO % Until DONE
BEGIN
INITIALIZE (T);
RUN OBJECT/PR [T];
IF T IS COMPLETEDOK THEN
DONE := TRUE;
ELSE
BEGIN
RESPONSE := ACCEPT
("PR task failed. Enter R for retry, Q to quit");
IF RESPONSE NEQ "R" AND RESPONSE NEQ "r" THEN
DONE := TRUE;
END;
END
UNTIL DONE;

END JOB

Runs the task OBJECT/PR. If the task fails, asks the operator whether to retry the task.

DO . . . UNTIL DONE

Repeats the enclosed set of statements until the variable DONE is TRUE.

8807 7391-006 5–13


Running Tasks

IF T IS COMPLETEDOK THEN . . .

Exits the DO loop if the task completed normally.

RESPONSE := ACCEPT . . .

Suspends the job. The job appears in the Waiting Entries display with the message
ACCEPT: PR task failed. Enter R for retry, Q to quit. To retry the task, the operator responds
with the command:
<mix number> AX R

To quit retrying the task, the operator responds with the command:
<mix number> AX Q

IF RESPONSE NEQ ″R″ AND RESPONSE NEQ ″r″ THEN . . .

Allows for the possibility that the operator might enter the R in uppercase or lowercase. If
the operator enters anything except R or r, the job quits retrying the task.

Retrying a Task with Validated Operator Approval


BEGIN JOB TEST/WFL;
BOOLEAN GOODRUNACTUAL := FALSE;
SUBROUTINE RUNPROG(STRING TASKNAME,
BOOLEAN GOODRUN);
BEGIN
TASK T;
BOOLEAN QUIT,
VALIDINPUT;
GOODRUN := FALSE;
QUIT := FALSE;
DO % Until GOODRUN or QUIT
BEGIN
INITIALIZE (T);
RUN #TASKNAME [T];
IF T IS COMPLETEDOK THEN
GOODRUN := TRUE;
ELSE
BEGIN
VALIDINPUT := FALSE;
DO % Until VALIDINPUT
BEGIN
CASE ACCEPT
(TASKNAME &
" failed. Enter R for retry, Q to quit")
OF
BEGIN
("R","r"): VALIDINPUT := TRUE;
("Q","q"): BEGIN
VALIDINPUT := TRUE;
QUIT := TRUE;
END;
ELSE : DISPLAY ("Incorrect response");

5–14 8807 7391-006


Running Tasks

END;
END
UNTIL VALIDINPUT;
END;
END
UNTIL GOODRUN OR QUIT;
END RUNPROG;
% Start Main Portion of Job
RUNPROG("OBJECT/PR", GOODRUNACTUAL);
IF NOT GOODRUNACTUAL THEN
BEGIN
RUNPROG("OBJECT/PR/RECOVER", GOODRUNACTUAL);
IF NOT GOODRUNACTUAL THEN
ABORT ("Job aborted because PR/RECOVER failed");
END;
RUNPROG("OBJECT/PR/SUMMARY", GOODRUNACTUAL);
END JOB

Performs functions similar to the previous example, “Retrying a Task if Operator


Approves.” However, this version of the example protects against typographical errors on
the part of the operator. This version also locates the retry code inside a subroutine, so
that the code can easily be reused for different tasks.

This example is fairly advanced. You might understand it more easily after reading
Section 12, Flow of Control.

SUBROUTINE RUNPROG;

Runs a task and retries the task if necessary. Although the subroutine is declared near the
start of the job, the subroutine is not actually executed until it is invoked by the RUNPROG
statements later on.

% Start Main Portion of Job

A comment indicating the location where execution actually begins: after all the
declarations. The preceding subroutine is considered a type of declaration.

DO . . . UNTIL GOODRUN OR QUIT;

Repeats the RUN statement until the task is COMPLETEDOK or the operator enters a
<mix number> AX Q system command. GOODRUN OR QUIT is a Boolean expression. For
more information about Boolean expressions, refer to Section 13, Working with Data.

RUN #TASKNAME [T];

Runs the program specified by the TASKNAME subroutine parameter.

DO . . . UNTIL VALIDINPUT;

Repeats the prompts for operator input until the operator enters a correct response.

8807 7391-006 5–15


Running Tasks

CASE ACCEPT . . .

Examines the operator input and determines whether the operator input is good.

RUNPROG(″OBJECT/PR″, GOODRUNACTUAL);

Invokes the subroutine RUNPROG. The subroutine runs the program OBJECT/PR and
updates the value of GOODRUNACTUAL to indicate whether the program completed
normally.

IF NOT GOODRUNACTUAL THEN . . .

Takes special actions if the previous task never completed successfully. NOT
GOODRUNACTUAL is a Boolean expression that evaluates to TRUE if
GOODRUNACTUAL is FALSE.

Running Several Tasks at the Same Time


If your WFL job runs multiple tasks, you have a choice between running the tasks one
after another or running them at the same time (in parallel).

Flow of Control for Tasks


The following figure shows the flow of control for a job that runs tasks one after another.
The job uses a RUN statement to initiate each task. The job itself is suspended and can do
no work while each task runs.

The following figure shows the flow of control for a job that runs two tasks at the same
time. The job uses a PROCESS RUN statement to initiate each task. The job and the tasks
run in parallel; that is, all can do work at the same time.

5–16 8807 7391-006


Running Tasks

Tasks that run in parallel with the job are also known as asynchronous tasks.

Why Run Tasks in Parallel?


Running tasks in parallel might enable the job to complete more quickly. However, you
must consider the following issues before deciding to run tasks in parallel:
• Parallel tasks compete for system resources, such as processor time, memory, and
I/O channels. Because of this competition, tasks run in parallel might take as long or
longer to run than the same tasks run sequentially.
• If two tasks use data from the same disk file, then the tasks can interfere with each
other if run in parallel. For example, one task might write data to the file that
overwrites data written by another task. You must use fairly complex programming
techniques to enable two programs to safely use the same disk file at the same time.
For details, refer to the Task Management Programming Guide.

Initiating Parallel Tasks


BEGIN JOB FINANCIAL;
PROCESS RUN OBJECT/INITIAL("WEEKEND");
PROCESS COPY FINANCE/OUTPUT/= FROM ACCTS(PACK) TO HIST(PACK);
REMOVE INIT/PAYABLE ON PACK;
END JOB

Initiates the program OBJECT/INITIAL and a copy task. The job then executes the
REMOVE statement while the two tasks are still running.

Initiating Parallel and Sequential Tasks


BEGIN JOB FINANCIAL;
PROCESS RUN OBJECT/CHARGES ON TRANS(PACK);
RUN OBJECT/INITIAL("WEEKEND");
REMOVE INIT/PAYABLE ON PACK;
END JOB

8807 7391-006 5–17


Running Tasks

Initiates a parallel task and then a sequential task. Because OBJECT/INITIAL is a


sequential task, the REMOVE statement is not executed until OBJECT/INITIAL
terminates. However, the REMOVE statement might be executed before
OBJECT/CHARGES terminates, because OBJECT/CHARGES is running in parallel.

Waiting for Tasks to Terminate


WFL automatically waits for tasks to terminate before ending the job or exiting any
subroutine. You can use the WAIT statement for additional control over waiting.

Job Termination and Parallel Tasks


BEGIN JOB FINANCIAL;
PROCESS RUN OBJECT/INITIAL("WEEKEND");
PROCESS RUN OBJECT/REPROC;
END JOB

The system automatically prevents any WFL job from terminating while tasks of the job
are still running. Thus, the preceding job does not terminate until OBJECT/INITIAL and
OBJECT/REPROC have both completed.

Subroutine Exit and Parallel Tasks


BEGIN JOB FINANCIAL;
SUBROUTINE PROCRUN;
BEGIN
PROCESS RUN OBJECT/INITIAL("WEEKEND");
PROCESS RUN OBJECT/REPROC;
END;

PROCRUN;
COPY FINANCE/OUTPUT/= FROM ACCTS(PACK) TO HIST(PACK);
END JOB

The system automatically prevents any WFL subroutine from exiting while tasks of that
subroutine are still running. Thus, in the preceding job, subroutine PROCRUN does not
terminate until OBJECT/INITIAL and OBJECT/REPROC have both completed. Because
the COPY follows the subroutine invocation, the COPY statement is not executed until
OBJECT/INITIAL and OBJECT/REPROC have completed.

Explicitly Waiting for Parallel Tasks


BEGIN JOB FINANCIAL;
TASK T1, T2;
PROCESS RUN OBJECT/INITIAL("WEEKEND") [T1];
PROCESS RUN OBJECT/REPROC [T2];
WAIT(T1);
WAIT(T2);
COPY FINANCE/OUTPUT/= FROM ACCTS(PACK) TO HIST(PACK);
END JOB

5–18 8807 7391-006


Running Tasks

The WAIT statements in this job ensure that the COPY statement is not executed until
OBJECT/INITIAL and OBJECT/REPROC are both finished.

Waiting for Changes in Task Status


BEGIN JOB FINANCE/JOB;
TASK T1, T2;
PROCESS RUN OBJECT/INITIAL [T1];
PROCESS RUN OBJECT/REPROC [T2];
DO
BEGIN
WAIT;
IF (T1 IS STOPPED) OR (T2 IS STOPPED) THEN
BEGIN
T1(STATUS = TERMINATED);
T2(STATUS = TERMINATED);
START FINANCE/JOB; STARTTIME = + 01:00;
END;
END
UNTIL (T1 IS COMPLETED) AND (T2 IS COMPLETED);

END JOB

This job runs two tasks in parallel and monitors the tasks to see if they become
suspended. A suspended task is one that cannot progress, usually because some needed
resource such as a file is missing. A operator can often use system commands to resume
a suspended task. However, this particular job does not give the operator any chance to
resume the task. Instead, the job terminates both tasks and restarts itself an hour later.

DO . . .UNTIL (T1 IS COMPLETED) AND (T2 IS COMPLETED)

Repeats the statements between BEGIN and END until both tasks have completed. This
statement uses a Boolean expression, as discussed under “Checking the State of a Task”
in Section 13, Working with Data.

WAIT;

Causes the job to wait until there is a change in the status of any of its tasks.

Note: This WAIT statement is important. Without this statement, the DO loop would
repeat rapidly and could use up all the system processor time.

IF (T1 IS STOPPED) OR (T2 IS STOPPED). . .

Detects if either of the tasks have become suspended. This statement uses a Boolean
expression.

<task variable>(STATUS = TERMINATED);

Terminates the tasks; that is, stops execution of the tasks and removes them from
memory.

8807 7391-006 5–19


Running Tasks

Waiting for a Task Attribute Value


PROCESS RUN OBJECT/COMDAT;
WAIT (T(SW1));
WAIT (T(TASKVALUE) = 0);
WAIT (T(STATUS) IS TERMINATED);

Initiates a task in parallel and waits for each of three task attributes to achieve certain
values.

Notice that the syntax used to wait for each of the task attributes is slightly different. The
differences arise because SW1 is a Boolean attribute, TASKVALUE is a real attribute, and
STATUS is a mnemonic attribute.

The job automatically resumes execution if the task terminates, even if the task attributes
still do not have the requested values.

Passing Parameters to a Task


RUN OBJECT/REORD(16.3, 4, TRUE, "MONTHLY");

Passes four parameters to the program OBJECT/REORD. Parameters are values that
change the way a program runs. You can pass parameters only to programs that are
designed to receive them. The parameters that you pass must match the number, type,
and order of the parameters in the program.

In addition to passing parameters, WFL jobs can receive parameters from START
statements. Refer to “Job Parameters: Making Your Job Flexible” in Section 13, Working
with Data.

Matching the Parameter Types in a Program


The RUN statement can include four types of parameters: Boolean, integer, real, and
string. The following table shows some of the matching types of parameters for programs
written in various languages.

WFL Parameter Type Matching Parameters in Programs

Boolean ALGOL: BOOLEAN


COBOL74: 77 BINARY Elementary Item
COBOL85: 77 BINARY PIC 9(1-11)
Pascal: Boolean or Boolean Subrange

5–20 8807 7391-006


Running Tasks

WFL Parameter Type Matching Parameters in Programs

Integer ALGOL: INTEGER


COBOL74: 77 BINARY Elementary Item
COBOL85: 77 BINARY PIC 9(1-11)
Pascal: Char, Char Subrange, Enumeration, Enumeration Subrange,
Fixed (n < 12), Integer, Integer Subrange, Sfixed (n < 12)

Real ALGOL: REAL


COBOL74: 77 REAL Elementary Item
COBOL85: 77 REAL Elementary Item
Pascal: Real or Short Set (1-48 elements)
String ALGOL: REAL ARRAY, REAL VALUE ARRAY
C: Int argc, Char *argv
COBOL74: 01 BINARY Group Item
COBOL85: 01 REAL Group Item
Pascal: Array of Explicit Data Type, Array of Packed Array, Array of
Real, Array of Record, Array of Set, Array of Vlstring, Explicit
Record (call-by-value), Long Set (> 48 elements), Packed Array of
Real, Packed Array of Record, Packed Array of Set, Packed Array of
Vlstring, Record, or Vlstring

For further information about parameter type matching, refer to the Task Management
Programming Guide.

Passing Parameters by Reference


Rationale

Pass parameters by reference if you expect the task to make changes to the values of its
parameters, and you want these changes to be visible to the WFL job. If you do not pass
the parameters by reference, then the parameters in the WFL job retain their original
values, even if the task assigns different values to the parameters internally.

Example
BEGIN JOB RUNPB;
BOOLEAN ERR := FALSE;
INTEGER COUNTER := 10;
REAL FRAC := 0.5;
STRING TXT := "MONTHLY";

RUN OBJECT/PB(ERR REFERENCE,


COUNTER REFERENCE,
FRAC REFERENCE,
TXT REFERENCE);

8807 7391-006 5–21


Running Tasks

IF ERR <> FALSE THEN


BEGIN
DISPLAY "Error in PB run";
DISPLAY "Counter = " & COUNTER;
DISPLAY "Frac = " & FRAC;
DISPLAY "Txt = " & TXT;
END;

END JOB

Uses the REFERENCE keyword to pass parameters by reference, and then checks the
values of the parameters after the task has completed.

Incorrect Example
RUN OBJECT/REORD(16.3 REFERENCE, 4 REFERENCE, TRUE REFERENCE,
"MONTHLY" REFERENCE);

When you pass a parameter by reference, you must pass a variable to that parameter. The
parameters in the preceding example are incorrect because they attempt to pass literal
values by reference. That is, the parameters in the example are values like 16.3, 4, and
TRUE, rather than names of variables that store those values.

5–22 8807 7391-006


Section 6
Managing Files

WFL provides statements that enable you to


• Rename disk files.
• Remove disk files.
• Determine if a file is resident.
• Read file attributes.
• Change file security.
• Change object code file attributes.

Permanent Directories
The ClearPath MCP systems support permanent directories. Comment to subsequent
writers: the A Series operating system is considered to be a subset of the ClearPath MCP
operating system. The subset does not support permanent directories.

Except in the permanent directory namespace, MCP servers do not use permanent
directories of the type you find on Windows or UNIX systems. In this manual, the term
directory is simply shorthand for a collection of files whose titles begin with one or more
of the same elements. Thus, the CHANGE statement, which is discussed later in this
section, renames files whose titles begin with (OPS)RESULTS. There is no need to
separately rename the directory itself.

Directories on a ClearPath MCP System


The permanent directories feature enables you to create permanent directories on an
MCP environment disk that are similar to the directories in the Windows client
workstation environment. This feature is available on the HMP 3.0 and later releases, and
can be enabled only on ClearPath MCP systems.

Permanent Directory Namespace


ClearPath MCP systems support a permanent directory namespace consisting of files
whose names start with *DIR. This namespace enables you to create permanent
directories on an MCP environment disk that provide extensive file creation and access
security controls. In this namespace, it is necessary to rename a directory separately from
the files within it.

8807 7391-006 6–1


Managing Files

For an explanation of permanent directories, refer to the System Administration Guide.

CHANGE: Renaming Disk Files


The CHANGE statement changes the names of one or more files.

Renaming a Single File


CHANGE AUDIT/DB TO AUDIT/DAILY;

Changes the file with the name AUDIT/DB to the name AUDIT/DAILY.

Caution
If a file already exists with the new file name, the system deletes the existing
file before making the change. The system does not request any confirmation
before making the deletion. This caution does not apply when you rename an
entire directory. In that case, the system preserves existing files, as discussed
in the following subsection.

Renaming a Directory
CHANGE (OPS)RESULTS/= TO (OPS)SAVE/=;

Changes all the files in the directory RESULTS/= to the directory SAVE/=.

Rules

If the new directory name already exists, the files are added to that directory. Any files that
already belonged to the new directory remain unchanged.

When you rename a directory of files, the system avoids overwriting any existing file. The
system renames as many of the files as it can without creating conflicts, and leaves the
other file names unchanged.

Example of Effects

The following table shows the effects of this statement on a set of files. The Before
column lists the names of the files before the CHANGE statement is executed. The After
column lists the names of the files after the CHANGE statement is executed.

6–2 8807 7391-006


Managing Files

Before After

RESULTS/INPUT RESULTS/INPUT (name is unchanged because of conflict with


existing file SAVE/INPUT)
RESULTS/USERS SAVE/USERS

RESULTS/DEVCON SAVE/DEVCON

SAVE/INPUT SAVE/INPUT
SAVE/QDATA SAVE/QDATA

Renaming Files on a Specified Family


CHANGE WEEKLY/REPORT ON USERC TO DAILY/REPORT;

Changes the name of a file on family USERC.

Rules

The ON <family> part, if it is included, must follow the old file name rather than the new
file name.

If an ON <family> part is not included, the file is assumed to be on family DISK.

Family Substitution for CHANGE Statements


BEGIN JOB;
FAMILY DISK = ACCT OTHERWISE DEVPK;
CHANGE DAILY/REPORT TO DAILY/BACK;
END JOB

Changes the name of DAILY/REPORT ON ACCT to DAILY/BACK ON ACCT. The system


does not search DEVPK, even if the file is not present on ACCT.

Rules

Family substitutions can affect CHANGE statements, but only the primary family is used.
In the preceding example, ACCT is the primary family in the family substitution. For a more
detailed description of family substitution, refer to Equating the Family Statement in
Section 5, Running Tasks.

Renaming Multiple Targets


CHANGE TRACKER/= TO TRAIL/=, REPORTS/INPUT TO REPORTS/OLDDATA;

Changes the name of a directory and also changes the name of a particular file. These two
requests are not related. For example, REPORTS/INPUT is not assumed to be part of the
directory TRACKER/=.

8807 7391-006 6–3


Managing Files

Rule

A single CHANGE statement can rename multiple directories, multiple files, or both. The
requests must be separated by commas.

Specifying the Family for Multiple Targets


CHANGE PRELIM/OUT ON USERC TO QDATA/OUT, DB/= ON USERC TO DB/=;
CHANGE PRELIM/OUT TO QDATA/OUT, DB/= TO DB/= FROM USERC

These two statements are equivalent. Each renames a file and a directory on family
USERC. The first statement explicitly specifies ON USERC for each request. The second
statement includes a FROM USERC clause that applies to both requests.

Rules

The FROM clause specifies the family name for one or more preceding change requests.

Specifying Different Families for Multiple Targets


CHANGE PRELIM/OUT TO QDATA/OUT, DB/= TO DB/= FROM USERC,
DEBIT/COUNTER TO REMINDER/INPUT FROM ACCTPK;

Renames files and directories on two different families. The FROM USERC clause applies
to PRELIM/OUT and DB/=. The FROM ACCTPK clause applies to REMINDER/INPUT.

Rules

When there are multiple FROM clauses, each change request is affected by the first
FROM clause that follows the request.

Changing a File to a Different Family


MOVE PRELIM/OUT FROM USERC TO ACCTPK;

Copies a disk file from one family to another, and then removes the original file.

Rules

The CHANGE statement cannot change the family name, as this change would require
physically moving the file to a different family. You can use the MOVE statement to
accomplish this purpose.

Using String Expressions in CHANGE Statements


STRING USERC := "SUSAN",
USERPK := "ARCH";
CHANGE (#USERC)OPTIONS ON #USERPK TO REPORT/#TIMEDATE(YYMMDD);

% If today is May 24, 2001, the following is equivalent:


CHANGE (SUSAN)OPTIONS ON ARCH TO REPORT/010524;

6–4 8807 7391-006


Managing Files

Specifies two CHANGE statements that are similar, except that one uses string
expressions to specify portions of file names and a family name.

For more information about using expressions in file titles, refer to Building File Titles in
Section 13, Working with Data.

REMOVE: Removing Disk Files

Removing a Single File


REMOVE DATA/COUNTER ON ACCTPK;

Removes a single file.

Removing a Directory
REMOVE INVENTORY/= ON ARCH;

Removes all files in the directory INVENTORY/=.

Family Substitution for REMOVE Statements


BEGIN JOB;
FAMILY DISK = ACCT OTHERWISE DEVPK;
REMOVE DAILY/REPORT;
END JOB

Removes the file DAILY/REPORT ON ACCT. The system does not search DEVPK, even if
the file is not present on ACCT. /=.

Rules

Family substitutions can affect REMOVE statements, but only the primary family is used.
In the preceding example, ACCT is the primary family in the family substitution. For a more
detailed description of family substitution, refer to Equating the Family Statement in
Section 5, Running Tasks.

Removing Multiple Sets of Files


REMOVE TRACKER/=, DATA/COUNTER, ORDERS;

Removes a directory and two different files.

Rules

A single REMOVE statement can remove multiple directories, multiple files, or both. The
requests must be separated by commas.

8807 7391-006 6–5


Managing Files

Removing Files from Multiple Families


REMOVE ORDERS FROM ARCH, PRELIM/OUT, DB/= FROM USERPK,
DEBIT/COUNTER ON ACCT PK;

Removes files and directories on several different families. The FROM ARCH clause
applies to ORDERS. The FROM USERPK clause applies to PRELIM/OUT and DB/=. The
ON ACCTPK clause applies to DEBIT/COUNTER.

Rules
• The ON clause and the FROM clause each specify the family where files are located.
However, the ON clause affects only the immediately preceding file or directory. The
FROM clause can affect multiple files and directories.
• When there are multiple FROM clauses, each file is affected by the first FROM clause
that follows the request.
• If there is an ON clause, it must occur later in the REMOVE statement than any FROM
clauses. Otherwise, you receive the syntax error
'FROM' NOT ALLOWED BECAUSE 'ON' WAS SPECIFIED

Using String Expressions in REMOVE Statements


STRING USERC := "SUSAN",
USERPK := "ARCH";
REMOVE (#USERC)OPTIONS ON #USERPK;

Removes the file (SUSAN)OPTIONS ON ARCH. For more information about using
expressions in file titles, refer to Building File Titles in Section 13, Working with Data.

Determining if a File Is Resident


Checking by File Title
IF FILE CUST/INFO ON SERV IS RESIDENT THEN
RUN OBJECT/REPORTGEN

Runs the program OBJECT/REPORTGEN if the file CUST/INFO is present on SERV family.

A related expression is FILE <file title> ISNT RESIDENT . This expression returns
TRUE if the file is not present.

Checking by File Variable


FILE F(KIND = DISK, NEWFILE = FALSE, DEPENDENTSPECS = TRUE,
TITLE = CUST/INFO ON SERV);
IF F IS RESIDENT THEN
RUN OBJECT/REPORTGEN;

Has the same effect as the previous example. However, the statement uses the form
<file variable> IS RESIDENT

6–6 8807 7391-006


Managing Files

instead of
FILE <file variable> IS RESIDENT

Checking on a Remote Host


FILE F(KIND = DISK, NEWFILE = FALSE, DEPENDENTSPECS = TRUE,
TITLE = CUST/INFO ON SERV, HOSTNAME = MADRID);
IF F(AVAILABLE) = THEN
RUN OBJECT/REPORTGEN;

Runs the program OBJECT/REPORTGEN if the file CUST/INFO is present on SERV family
at the host MADRID.

HOSTNAME = MADRID

Specifies the host where the file is located.

F(AVAILABLE) = 1

Checks whether the file is present. You must use the AVAILABLE attribute because the IS
RESIDENT form is not supported for remote hosts.

Waiting for a File to be Resident


WAIT (FILE TEMP/INDEX/HTML IS RESIDENT

Waits until the file TEMP/INDEX/HTML is present.

Reading File Attributes


FILE F(KIND = DISK, NEWFILE = FALSE, DEPENDENTSPECS = TRUE,
TITLE = ACCT/DATA);
BOOLEAN LOCKEDVAL;
INTEGER ALTERVAL;
STRING FILEKINDVAL, TITLEVAL, FNAMEVAL, FAMILYVAL;
IF F IS RESIDENT THEN
BEGIN
OPEN (F);
LOCKEDVAL := F(LOCKEDFILE);
ALTERVAL := F(ALTERDATE);
FILEKINDVAL := F(FILEKIND);
TITLEVAL := F(TITLE);
FNAMEVAL := F(FILENAME);
FAMILYVAL := F(FAMILYNAME);
END;

Declares and opens a file, then reads the values of the following file attributes:
• FILE F . . .
Declares a file variable F.
• NEWFILE = FALSE

8807 7391-006 6–7


Managing Files

Specifies that the file already exists; it is not being created by this job.
• DEPENDENTSPECS = TRUE
Copies all the file attributes of file variable F from the physical file that is being opened.
• OPEN (F)
Attempts to open the file. If the file is not available, the job is suspended. The job
appears in the waiting entries display with a NO FILE condition. The job resumes
execution when the file becomes available.
• IF F IS RESIDENT THEN . . .
Checks to see whether the file is available for opening. By preceding the OPEN
statement with this check, we make it unlikely that the job will be suspended during
the file open.
• LOCKEDVAL := F(LOCKEDFILE) . . .
This and the following statements read the values of various file attributes. You simply
assign the file attribute to a variable of the correct type. To determine the data type of a
particular file attribute, refer to the File Attributes Programming Reference Manual.

Making Decisions Based on File Attribute Values

The job can make decisions based on file attribute values. First, you must check the value
with a Boolean expression, as described under Checking File Attribute Values in
Section 13, Working with Data.

Extracting Pieces of the TITLE Value

The TITLE file attribute returns a string with a fairly complex form, such as:
(ACCT)CUST/ARCHIVE ON SERV

If you are interested only in certain parts of the title, you can use different file attributes.
Thus, the FILENAME attribute returns only the following portion of the title:
(ACCT)CUST/ARCHIVE

The FAMILYNAME attribute returns only the family name:


SERV

Alternatively, you can parse a TITLE value into pieces, as described under “Parsing a File
Title” in Section 13, Working with Data.

Changing File Security


You can use the SECURITY statement to specify which users can access a file and what
actions they can perform on the file. Refer to Section 15, Security.

6–8 8807 7391-006


Managing Files

Changing Object Code File Attributes


Object code files can store task or file equations. These equations supply defaults for use
each time the program is run. You can supply these equations with the COMPILE
statement, or you can modify these equations later with the MODIFY statement. Refer to
Modifying Code File Equations Later in Section 10, Compiling Programs.

8807 7391-006 6–9


Managing Files

6–10 8807 7391-006


Section 7
Copying Files

This section explains the following topics:


• Copy request basics
• Using COPY defaults
• Preserving existing files at the destination
• Updating files by date
• Copy status
• Copying to a CD-ROM
• Copying to or from tapes
• Advanced COPY features
• Copy results
• Determining why a copy failed
• Handling waiting copy requests
• Copying files between hosts
• Copying files with Native File Transfer (NFT)
• Copying files with File Transfer Protocol (FTP)

Copy Request Basics


The following pages explain how to
• Submit copy requests from CANDE, MARC, Operations Center and at an ODT.
• Copy single files, multiple files, or directories of files.
• Copy all files from your own usercode or from another usercode.
• Copy all files on a family or all usercoded files on a family.
• Rename files as they are copied.
• Copy files between multiple sources and destinations.
• Combine separate copy requests.

8807 7391-006 7–1


Copying Files

Submitting Copy Requests


You can submit the COPY statement as part of a WFL job or as a command from CANDE,
MARC, Operations Center or at an ODT. For information about entering COPY as a
command, refer to Sources for Submitting WFL Statements or Jobs in
Section 3, Submitting WFL Statements and Jobs.

In general, you should store the COPY statement in a formal WFL job if the statement is
complex or if you plan on using it repeatedly. Otherwise, it is easier to simply type the
COPY statement as a command.

Copying Single Files


COPY OBJECT/PAYROLL/REPORT FROM DBFAM(PACK) TO SERV(PACK

Creates a copy of OBJECT/PAYROLL/REPORT on SERV family. The source file remains


present on DBFAM.

Note: If a file with the requested name already exists at the destination, the COPY
statement overwrites that file. If you want to prevent this overwriting, use the ADD
statement as described under “Preserving Existing Files at the Destination” later in this
section.

Copying Multiple Files


COPY OBJECT/PAYROLL/REPORT, DATA/INPUT
FROM DBFAM(PACK) TO SERV(PACK);

Copies the files OBJECT/PAYROLL/REPORT and DATA/INPUT from one disk family to
another.

Copying Directories
COPY DATA/= FROM DBFAM(PACK) TO SERV(PACK

Copies all the files in the directory DATA/= from one disk family to another. Does not copy
the file DATA itself (if there is one).

For information about copying all files under a directory between a local and remote host,
refer to Copying a Directory of Files to or from a Remote Host later in this section.

Copying All Files from Your Own Usercode


COPY DATA/= FROM DBFAM(PACK) TO SERV(PACK

Copies all the files under the usercode of the WFL job from DBFAM family to SERV family.
WFL jobs typically run under the usercode of the MARC or CANDE session where you
started the job.

7–2 8807 7391-006


Copying Files

Note: If you start a job from an ODT, the WFL job typically runs without a usercode. For
such a job, COPY = copies all files on the family, including both usercoded and
nonusercoded files.

Copying All Files from Another Usercode


COPY (SMITHJA)= FROM DBFAM(PACK) TO SERV(PACK

Copies all the files under the usercode SMITHJA from DBFAM family to SERV family.

Rule

If the usercode being copied from is different from the usercode of the job, then the job
must have special privileges. Refer to COPY or ADD in Section 15, Security.

Copying All Usercoded Files on a Family


COPY *USERCODE/= FROM ACCT(PACK) TO ARCH(PACK

Copies all the usercoded files from ACCT family to ARCH family. That is, this statement
copies all files except for nonusercoded (*) files.

Rule

This action requires the privileges discussed under COPY or ADD in Section 15, Security.

Copying Nonusercoded Files on a Family


COPY *SYSTEM/=, *OBJECT/= FROM ACCT(PACK) TO ARCH(PACK);

Copies two directories of nonusercoded files from ACCT family to ARCH family.

Rule

Copying directories of nonusercoded files requires the privileges discussed under COPY
or ADD in Section 15, Security.

Note: This example copies only selected directories. There is no COPY option for
copying all the nonusercoded files on a family. The *= form copies both usercoded and
nonusercoded files, as discussed later under “Copying All Files on a Family.”

Copying All Files on a Family


COPY *= FROM DBFAM(PACK) TO SERV(PACK);

Copies all the files on DBFAM family to SERV family. The files copied include files under all
usercodes as well as all nonusercoded files.

8807 7391-006 7–3


Copying Files

Rule

This action requires the privileges discussed under COPY or ADD in Section 15, Security.

Renaming Files during the Copy


COPY DATA/INPUT AS DATA/ FROM DBFAM(PACK) TO SERV(PACK);

Copies the single file DATA/INPUT and renames the file to DATA/OLD at the destination.

Renaming Directories during the Copy


COPY DATA/= AS SAVE/= FROM DBFAM(PACK) TO SERV(PACK);

Copies all the files in the directory DATA/= ON DBFAM to the directory SAVE/= ON SERV.

Changing the Usercode during the Copy


COPY DATA/= AS (JASMITH)REUSE/ORDER/=
FROM DBFAM(PACK) TO SERV(PACK);

Copies the files in the directory DATA/= to the directory REUSE/ORDER/= under usercode
JASMITH.

Rule

To copy files to a usercode different from that of the job, the job must have the privileges
discussed under COPY or ADD in Section 15, Security.

Copying Files from Multiple Sources


COPY MAILING/LIST, MAILING/NEWDATA/= FROM DEVPK(PACK),
CUST/DAT FROM SERV(PACK) TO SYSPK(PACK);

Copies files from two different disk families to a single destination family. Notice the
overall pattern of elements is FROM, FROM TO.
• MAILING/LIST and MAILING/NEWDATA/= are both copied from DEVPK family to
SYSPK family.
• CUST/DATA is copied from SERV family to SYSPK family.

Copying Files to Multiple Destinations


COPY MAILING/LIST, MAILING/NEWDATA/= FROM DEVPK(PACK)
TO SERV(PACK), TO SYSPK(PACK);

7–4 8807 7391-006


Copying Files

Copies files from a single disk family to two different destination families. Notice the
overall pattern of elements is FROM TO, TO.
• MAILING/LIST is copied from DEVPK family to SERV family and SYSPK family.
• MAILING/NEWDATA/= is copied from DEVPK family to SERV family and SYSPK
family.

Copying Files from Multiple Sources to Multiple Destinations


COPY DB/INPUT FROM SERV(PACK), TRANS/CODES
FROM ACCT(PACK) TO ARCH(PACK), TOSYSPK(PACK);

Copies files from two different families to two other families. Notice the overall pattern of
elements is FROM, FROM TO, TO.
• DB/INPUT is copied from SERV family to ARCH family and SYSPK family.
• TRANS/CODES is copied from ACCT family to ARCH family and SYSPK family.

Combining Separate Copy Requests


COPY DB/INPUT FROM SERV(PACK) TO ACCT(PACK),
TRANS/CODES FROM ARCH(PACK) TO SYSPK(PACK);

Copies two different files between separate sources and destinations. Notice the overall
pattern of elements is FROM TO, FROM TO.
• DB/INPUT is copied from SERV family to ACCT family.
• TRANS/CODES is copied from ARCH family to SYSPK family.

Using String Expressions in COPY Statements


STRING USER := "ICS",
DIR := "DAILY/RECORDS",
INPACK := "OPSPK",
OUTPACK := "ARCH";
COPY (#USER)#DIR/= AS #DIR/ARCH/=
FROM #INPACK(PACK) TO #OUTPACK(PACK

Copies (ICS)DAILY/RECORDS/= as DAILY/RECORDS/ARCH/= from OPSPK family to


ARCH family.

Rule

Use a number sign (#) prefix before any string expressions that you use in a COPY
statement. You can use string expressions to replace family names and all or any part of a
file name. For more information about using string expressions in file titles, refer to
Building File Titles in Section 13, Working with Data.

8807 7391-006 7–5


Copying Files

Using COPY Defaults


You can simplify your COPY statements by omitting items such as usercodes, source and
destination KIND values, and family names. However, when doing so, be aware of the
defaults that the system uses to supply the omitted values.

Usercode Defaults
If you do not specify the usercode for the source or destination file, the system supplies
defaults as discussed in the following text.

Omitting the Source Usercode


COPY DATA/INPUT AS (JD)DATA/INPUT FROM DBFAM(DISK) TO ARCH(DISK

The system searches for the source file first under the usercode of the WFL job, and
secondly as an unusercoded (*) file.

Omitting the Destination File Name


COPY (DAVIS)DATA/INPUT FROM DBFAM(DISK) TO ARCH(DISK);

The system creates the destination file under the same usercode as the source file
(DAVIS).

Omitting the Destination File Usercode


COPY (DAVIS)DATA/INPUT AS DATA/INPUT/SAVE
FROM DBFAM(DISK) TO ARCH(DISK);

The system creates the destination file under the usercode of the WFL job (not the
usercode of the source file).

KIND Defaults
The KIND attribute specifies whether the file resides on a DISK, PACK, CDROM, or
TAPE. The values DISK and PACK are synonymous.

Note: While DISK and PACK are values for the KIND attribute, they also can be the
names of particular disk families. Most systems have a family named DISK. When DISK or
PACK is used as a KIND value, the value appears in parentheses. Thus, REFAB(PACK)
refers to a disk family named REFAB. However, DISK(PACK) refers to the disk family
named DISK.

If a COPY statement omits a KIND value, the system uses the following rules to determine
the default value:

7–6 8807 7391-006


Copying Files

• If the volume is named DISK or PACK, the KIND defaults to DISK.


• If the volume is not referred to by name, the family name defaults to DISK and the
KIND defaults to disk.
• Otherwise, the KIND defaults to TAPE.

Omitting the Volume KIND Value


COPY DATA/INPUT FROM DISK(PACK) TO RAD;
COPY DATA/INPUT FROM DISK(PACK) TO RAD(TAPE);

These two statements are equivalent. The first statement omits the KIND attribute for the
destination volume. Because the volume is named RAD, but no KIND is specified, the
system assumes that RAD is a volume of KIND = TAPE.

Omitting the Volume Name


COPY = FROM LIBPK(PACK);
COPY = FROM LIBPK(PACK) TO DISK(PACK);

These two statements are equivalent. The first statement omits the destination volume.
The system therefore assumes that the volume is named DISK and is a disk family.

Specifying the KIND Value


COPY DATA/INPUT TO QFAM(KIND = DISK);
COPY DATA/INPUT TO QFAM(PACK);

These statements show two different ways of specifying the KIND attribute.

FAMILY Defaults
COPY DATA/INPUT TO RAD(TAPE);

Does not specify the source volume. Therefore, the source volume defaults to DISK.

Effect of Family Substitution

Suppose the current FAMILY value is DISK = UKFAM OTHERWISE REPRO. The effect of
the FAMILY statement is to make the system search for the source file on UKFAM family
instead of on DISK.

Note, however, that the OTHERWISE part of the FAMILY statement is not used for copy
requests. Thus, in this example, the system does not search for the file on REPRO family,
even if the file is not present on UKFAM.

For an explanation of family substitution, refer to Section 6, Managing Files.

8807 7391-006 7–7


Copying Files

Preserving Existing Files at the Destination

Adding Files from a Directory


ADD DOC/UPDATES/= FROM CUST(PACK) TO COMMON(PACK);

Copies all the files in DOC/UPDATES/= that do not yet exist at the destination.

The ADD statement is equivalent to the COPY statement, with one exception: the ADD
statement will not overwrite any existing files at a disk destination.

Suppose the following files reside at the source:


DOC/UPDATES/ONE
DOC/UPDATES/TWO
DOC/UPDATES/THREE

Suppose also that the following files already exist at the destination:
DOC/UPDATES/ONE
DOC/UPDATES/THREE

In this case, the system copies only the file DOC/UPDATES/TWO, because copying either
of the other files would require overwriting an existing file at the destination.

Note: For tape destinations, the ADD statement is equivalent to the COPY statement.
That is, the ADD statement does not preserve existing files at a tape destination.

Adding the Same Files to Multiple Destinations


ADD REPORT1, REPORT2 FROM CUST(PACK)
TO COMMON(PACK), TO DBFAM(PACK);

Adds the same two files to two different disk destinations.

Note that different subsets of the requested files might be copied to each destination. For
example, if REPORT1 already exists on COMMON family, then the statement copies only
REPORT2 to COMMON. If REPORT1 and REPORT2 both exist on DBFAM family, then the
second statement does not copy either file to DBFAM.

Updating Files by Date


Rationale

Suppose you want to avoid overwriting any destination files that are newer than the
corresponding source files. The following example accomplishes this goal by reading the
ALTERDATE file attribute of the source file and the destination file.

7–8 8807 7391-006


Copying Files

Example
FILE SOURCE(KIND = DISK, NEWFILE = FALSE, DEPENDENTSPECS = TRUE);
FILE DEST(KIND = DISK, NEWFILE = FALSE, DEPENDENTSPECS = TRUE);
STRING FILEN := "TEMP/INDEX/HTML",
SFAM := "DEVPK",
DFAM := "USERPK";
BOOLEAN UPDATE;

SOURCE (TITLE = #FILEN ON #SFAM);


OPEN (SOURCE);
DEST (TITLE = #FILEN ON #DFAM);
IF DEST IS RESIDENT THEN
OPEN (DEST)
ELSE UPDATE := TRUE;
IF (SOURCE(ALTERDATE) GTR DEST(ALTERDATE))
THEN
UPDATE := TRUE;
IF UPDATE THEN
COPY #FILEN FROM #SFAM (PACK) TO #DFAM (PACK);

Explanation
• SOURCE and DEST
The source and destination files for the copy. These files must be explicitly declared
and opened before their file attributes can be read.
• ALTERDATE
The date when the data in the file was most recently changed. The date is an integer
of the form YYYDDD. For example, 98028 means January 28, 1998. Note that the
value changed from 99365 to 100001 on January 1, 2000.
• (SOURCE(ALTERDATE) GTR DEST(ALTERDATE))
True if the source file is newer than the destination file.

Determining Copy Status

Library Maintenance Tasks


COPY CTAM/= FROM DBMAST(PACK) TO ACMAST(PACK)
#RUNNING 9847
#BOT 9848 (MARTINEZ)WFLCODE
#BOT 9849 *LIBRARY/MAINTENANCE

The preceding COPY command was entered in CANDE. Notice that the statement
initiates a task called *LIBRARY/MAINTENANCE, which performs the actual copying. If
the file is being copied from one host to another, this task is named *FILE/TRANSFER. You
can see these tasks referred to in system messages and in the output from mix display
commands such as A (Active Mix Entries).

8807 7391-006 7–9


Copying Files

Monitoring Progress of a Copy


COPY ACTDATA/= FROM REPOS(PACK) TO ACMAST(PACK);
#RUNNING 9847
#BOT 9848 (WONG)WFLCODE
#BOT 9849 *LIBRARY/MAINTENANCE

?9849 HI
#9849 COPY -- COPYING (FILE 21 OF 30) (WONG)ACTDATA/431/950919
(39%) FROM REPOS TO: ACMAST

A user enters a COPY command in CANDE. The COPY command initiates


LIBRARY/MAINTENANCE. The user enters the HI (Cause EXCEPTIONEVENT) system
command to display the current status of the copy task. Note that the HI command must
specify the mix number of the LIBRARY/MAINTENANCE task (in this case, 9849).

The preceding response shows that the system is 39 percent done copying the current
file, which is the 21st of 30 files.

SEARCHING FOR FILE Status


#3609 COPY -- SEARCHING FOR FILE (FILE 3 OF 5)
(PETRU)OBJECT/DBSORT FROM UTILS[UT982] TO: ACMAST

This response indicates that the system has finished copying the two files, but has not yet
started copying the third file. This example is for a copy from a tape with the serial number
UT982.

Copying to the CD-ROM


COPY to KIND=CD writes an image of a library maintenance format CD-ROM to a
temporary disk file. The image is then transferred to a blank CD-R disc that is mounted on
a CD-R drive connected directly to a SCSI channel adapter.

Note: CD-R drives function as CD-ROM drives when reading CD-ROMs; however, CD-R
drives can also write to blank write-once CD-R media, creating a CD-ROM.

Track at once is the default recording mode. If you specify the attribute PACKETWRITE,
packet write recording is used. Additionally, you can specify how many copies of the disc
are to be burned with the attribute CDCOPIES, and build multivolume CD-ROM sets with
the attribute MULTIVOLUME. Refer to the explanations for each of these settings in the
following paragraphs.

Before the CD-ROM disc is finalized with the CLOSE SESSION SCSI command, the entire
data track is read and compared with the image file to ensure that no media defects
affected the burn.

Note: Except during this compare operation, the MCP refuses to read any CD-ROM disc
that is not finalized. Discs that fail the compare operation cannot be read by mistake in the
future.

7–10 8807 7391-006


Copying Files

The family used for the temporary disk file must have room for the entire image. Also, for
track at once recording, you cannot use a family that is heavily used by other programs.
The temporary disk file is created on the default family of the task executing the COPY
statement, unless you set the TASKSTRING attribute of that task to FAMILYNAME =
<family name>.

See “Examples” later in this section.

Track at Once
Track at once is the default recording mode and is normally used to create CDROMs to
be read in CD-ROM drives or to create master CD-ROMs for replication. However, this
mode carries a potential risk of “buffer underrun.” Buffer underrun occurs when the
CD-ROM drive buffers become empty in the middle of a track, consequently ruining the
disc. To reduce this risk, track at once recording uses ten output buffers of 391,168 bytes
and permits the implementation to run at MCP priority while writing to the CD-ROM drive.

The following events cause buffer underrun:


• Memory dump
• Path failure or path reconfiguration anywhere on the paths to the CD-ROM drive or the
CD-ROM image disk file
• Heavy contention for the disk drives containing the CD-ROM image disk file
• Very long stack searches
• Some CD-RW drives support a buffer underrun prevention feature. The MCP enables
this feature on such drives. With this feature enabled, these drives resume writing
after a buffer empty condition. Hence, buffer underrun does not occur in track at once
recording mode and you do not need to use the packet write recording mode.

Packet Write
Packet write recording causes the data to be written to the CD-ROM in relatively small
packets and is selected by specifying the PACKETWRITE attribute.

The default value of PACKETWRITE is FALSE. When set to TRUE, packet write recording
is used when the CDROM is written; otherwise, track at once recording is used.

Packet write recording has the following advantages and disadvantages compared with
track at once:

Advantages Disadvantages

The risk of buffer underrun is eliminated. The resulting disc can be read only in CD-R
drives.

8807 7391-006 7–11


Copying Files

Less save memory is used for output The resulting disc cannot be used as a master
buffers—130,390 words of output buffers are for replication. Track at once output must be
used for packet write versus 651,950 words used for this purpose.
for track at once.

The burn runs at normal priority. The capacity of the disc is reduced by 3.6
percent and throughput is reduced when
writing to the disk.

Because of the limitations of packet write, it is currently used only to backup and restore
files.

Multivolume
Multivolume recording causes the data to be written to multiple CD-ROMs when the data
overflows a single CD-ROM. The default value of MULTIVOLUME is TRUE. If
MULTIVOLUME is FALSE when a data overflow occurs, the copy is terminated with an
error.

When a multivolume set is written, the data for a given CD-ROM is written to a temporary
disk file, the CD-ROM is burned, and the temporary disk file is removed, all before the data
for the next CD-ROM is written to a temporary disk file. This allows the system to
determine whether storage capacity equal to or less than the CD-ROM is needed.

In a multivolume copy, the system splits files across CD-ROM boundaries. This capability
makes it possible to copy to a set of CD-ROM files that are much larger than the capacity
of a single CD-ROM.

Each CD-ROM in a multivolume set has a complete library maintenance directory listing
all files on the entire set. As a result, you can use the TDIR system command on any of the
CD-ROMs to list all files on the set.

The directory of a given CD-ROM (volume N) of a multivolume set contains the correct
locations for the file data of all files located on previous CD-ROMs in the set (volumes 1
thru N).

However, the directory records the location of all subsequent files as volume N+1. For
example, if volume 1 of a multivolume set is mounted and you enter a COPY command
specifying a file that happens to be on volume 3, the system asks for volume 2. If volume 2
is then mounted, the system asks for volume 3. If volume 3 is mounted, the COPY is then
carried out.

CD Copies
You can specify how many copies of a CD-R disc are to be burned with the attribute
CDCOPIES. The default value of CDCOPIES is 1.

7–12 8807 7391-006


Copying Files

When data is copied to a CD-R disc, it is first copied from the source media to a temporary
disk file. The data in the temporary disk file is formatted exactly as it is to appear on the
CD-ROM. The temporary disk file is then copied to a CD-R drive. CDCOPIES causes the
disk file to be copied to the CD-R drive as many times as you specify, without having to
re-copy the data from the source media.

Restrictions
• The capabilities of KIND=CD apply only to the COPY statement and are not valid with
the ADD statement.
• The only “& options” permitted are COMPARE, DSONERROR, WAITONERROR, and
REPORT.
• There can be only one destination volume and the destination volume cannot require
quotes.
• The source and destination volumes must both be on the local host. NFT is not
supported.
• When the MULTIVOLUME file attribute is set to FALSE, the data must fit on a single
CD-ROM.
- For track at once output, a single CD-ROM holds 681,984,000 bytes or 333,000
CD-ROM sectors of 2,048 bytes each.
- For packet write output, a single CD-ROM holds 657,553,408 bytes or 321,071
CDROM sectors of 2,048 bytes each.
• All errors except skipped files are fatal and cause the task executing the COPY
statement to terminate with a failure.

Examples
Example 1
COPY TEST1, TEST2 TO GGG(CD);

A library maintenance CD-ROM named GGG is created. The disk contains files TEST1 and
TEST2.

Example 2
BEGIN JOB J;
TASK T;

T(TASKSTRING= "FAMILYNAME = BLUE");

COPY *SYSTEM/PRINT/= TO SYSTEM_PRINT(CD) [T];


END JOB

A library maintenance CD-ROM named SYSTEM_PRINT is created. The disc contains all
the files from *SYSTEM/PRINT/=.

The temporary disk file used to hold the CD-ROM image is placed on family BLUE.

8807 7391-006 7–13


Copying Files

Example 3
COPY (USER9)= FROM GREEN(PACK),
= FROM TEST4 (SERIALNO= "123321"),
*SYSTEM/PRINT/= FROM SYSTEM_45123;

A library maintenance CD-ROM named SYSTEM_012 is created. The disc contains all the
files from (USER9)= on family GREEN, from tape TEST4 (with serial number 123321), and
from *SYSTEM/PRINT/= on CD SYSTEM_45123.

Copying to or from Tape


The following pages explain the following topics:
• Understanding library maintenance tapes
• Selecting the source tape
• Selecting the destination tape
• Specifying whether to unload the tape
• Copying from multiple sources to a single tape
• Compressing data
• Locking the tape
• Using multireel tape sets
• Understanding tape directories
• Using tape directory disk files
• Expanding library maintenance tapes

Library Maintenance Tapes


The COPY statement is intended primarily for use with disk files. The COPY statement
supports tapes because they can be used as a backup medium for disk files. Therefore,
when you copy files from disk to tape, the COPY statement creates a tape with a special
format that preserves the structure and attributes of the original disk files. This type of
tape is referred to as a library maintenance tape.

Conversely, when you copy files from a tape, the COPY statement expects the tape to be
a library maintenance tape. When you copy files from tape to disk, COPY creates disk files
with the same file attributes that the files had before they were copied to tape.

Tapes created by application programs are usually not library maintenance tapes. To copy
data to or from such tapes, you must use another utility such as SYSTEM/DUMPALL. For
information about SYSTEM/DUMPALL, refer to the System Utilities Operations Reference
Manual.

7–14 8807 7391-006


Copying Files

Selecting a Source Tape


The COPY statement can use a tape name or serial number to select the source tape.

Selecting the Source by Tape Name


COPY = FROM MYTAPE TO DBFAM(PACK);
#RUNNING 9094
#BOT 9095 (RADU)WFLCODE
#BOT 9096 *LIBRARY/MAINTENANCE
#9096 NO FILE MYTAPE/FILE000 (MT) #1

A user enters a COPY command in CANDE. The command copies all files from a tape
named MYTAPE. If no tape of that name is mounted, the system suspends the job. The
operator must either mount a tape with the requested name, or use the IL (Ignore Label)
system command to specify the tape drive that should be used, as in the following
example.
9096 IL MT 30

Selecting the Source by Serial Number


COPY = FROM MYTAPE(SERIALNO="DBK009") TO DBFAM(PACK);

Copies all files from a tape with the tape name MYTAPE and the serial number DBK009.

If no tape of that serial number is mounted, the system suspends the job. Messages such
as the following appear in CANDE:
#RUNNING 6745
#BOT 6746 (JOSEPH)WFLCODE
#BOT 6747 *LIBRARY/MAINTENANCE
#6747 NO FILE MYTAPE/FILE000 (MT) [DBK009] #1

At this point, you can either mount a tape with the requested serial number or use a
command such as IL (Ignore Label) to specify the tape drive to be used.

Rules

If the serial number includes only digits, then the quotes (″) are optional. If you omit
quotes, the system adds leading zeros if necessary to make the number six digits long. If
you include quotes, the system adds trailing blanks instead. Thus, 123 is the same as
000123, but ″123″ is the same as ″123 ″.

Selecting Among Duplicate File Names from a Source Tape


COPY SYSTEM/ALGOL ORIGIN PACK;

Copies file SYSTEM/ALGOL that originated on the disk family PACK. This is useful when
files with the same filename were copied to one tape from different disk families. You can
specify which file you want by the original family name.

8807 7391-006 7–15


Copying Files

Selecting a Destination Tape


The COPY statement can select the destination tape in any of the following ways:
• By accepting any scratch tape
• By specifying the serial number of the tape
• By specifying the SCRATCHPOOL value of the tape
• By requesting a tape drive with a specified density

Using Scratch Tapes


Typically, the destination tape for a copy is a scratch tape. A scratch tape is a tape that is
empty of data but is labeled and ready for use. You can create such a tape with the SN
(Serial Number) or PG (Purge) system command.

Omitting the Serial Number for the Destination


COPY (JENNY)RECAP/= TO RECAP;
#RUNNING 9186
#BOT 9187 (OPS)WFLCODE
#BOT 9188 *LIBRARY/MAINTENANCE
#9188 RECAP/FILE000 REQUIRES MT #1

Copies files in CANDE, without specifying a serial number for the tape destination. The
system assigns the name RECAP to the destination tape. The system might suspend the
job, depending on whether the SERIALNUMBER system option is set.

If SERIALNUMBER is .
.. Then . . .

Set The system suspends the job. The operator must enter a command
such as the following OU (Output Unit) command to specify a tape
drive that has a scratch tape mounted.
9188 OU MT 12

Note: CANDE does not support the OU command, so you must


enter it in MARC, Operations Center, or at an ODT.

Reset The system opens any scratch tape that is mounted on a tape drive
and is not in use. If no such tape is available, the system suspends the
job until the operator mounts a scratch tape.

An operator can use the OP (Options) system command to set or reset the
SERIALNUMBER system option.

Using a Serial Number for the Destination


COPY (JENNY)RECAP/= TO RECAP(SERIALNO="JN33");

7–16 8807 7391-006


Copying Files

Copies files to a tape with the serial number JN33, regardless of which tape drive the tape
is mounted on. If no such tape is mounted, the system suspends the job. When the tape
is mounted, the system resumes execution of the job.

If you specify a serial number, the COPY statement will write to any tape that has that
serial number, even if the tape is not a scratch tape. The COPY statement overwrites all of
the data that is already on the tape.

Ensuring Unique Serial Numbers


Rationale

If you perform daily backups of files to tape, then you need some method of assigning
unique serial numbers to the backup tapes so you can tell them apart.

Example
COPY (RITA)POOL/= TO RITAP(SERIALNO= #TIMEDATE(YYMMDD));

Assigns a unique serial number based on the current date.

This technique guarantees uniqueness if the job is run no more than once a day. For more
frequent runs, you would need to incorporate a time as well as a date. You can accomplish
this effect with other forms of the TIMEDATE function, as discussed under Getting the
Date and Time in Section 16, Examining the System Environment.

Selecting from a Pool of Tapes


COPY (SUPPLY)INVENTORY/= TO INVENT(SCRATCHPOOL=MFC);

Copies files to any tape with a SCRATCHPOOL attribute of MFC. The system
automatically chooses a tape from any scratch tapes that are currently mounted and that
have a matching SCRATCHPOOL value of MFC.

Rules

The SCRATCHPOOL attribute is intended to identify a group of tapes that share a common
purpose or common ownership. An operator can assign a SCRATCHPOOL value to a tape
as part of a PG (Purge) or SN (Serial Number) system command, as in the following
examples:
PG MT 28 SCRATCHPOOL="MFC"
SN MT 28 PARTS SCRATCHPOOL="MFC"

The SERIALNUMBER system option has no effect on a copy request that specifies a
SCRATCHPOOL.

Requesting a Drive with a Specific Density


COPY (JENNY)RECAP/= TO RECAP(DENSITY=BPI38000);

8807 7391-006 7–17


Copying Files

Copies files to a scratch tape on any drive that supports the requested DENSITY value.
There are a number of DENSITY values that are supported by different types of tape
drives.

Rules

If the COPY statement specifies both a DENSITY and a SERIALNO for the destination
tape, then the system uses both criteria to select the tape. That is, the DENSITY and
SERIALNO must both match the tape.

Specifying Whether to Unload the Tape


COPY (JENNY)RECAP/= TO RECAP(AUTOUNLOAD=ON);

Copies files to a scratch tape and then automatically rewinds and unloads the tape. You
can use the AUTOUNLOAD option to make the system automatically rewind and unload
the tape when the copy is completed or when a reel switch occurs. The AUTOUNLOAD
option is useful because it makes it obvious to an operator when a tape is finished being
used and can safely be removed from the tape mount.

Copying from Multiple Sources to a Single Tape


COPY DATA/INPUT FROM DBFAM(PACK),
CUSTOMER/DATA FROM UKMAST(PACK) TO QUARK;

Copies files from multiple sources to a single tape.

Rules

You cannot use multiple COPY statements to copy files to the same tape. Therefore, if you
want to copy files from multiple sources to the same tape, you must combine the copy
requests into a single COPY statement.

Compressing Data
COPY (DANTON)COMFAB/= TO COMF(COMPRESSIONCONTROL =
USER, COMPRESSIONREQUESTED);

Copies files to a tape, and requests the tape unit to compress the data. The compression
options are meaningful only if the tape drive supports data compression.

Note: Use the compression options with care, as the resulting tape can be read only by a
tape drive that supports the same compression standard.

MT Display for a Compressed Tape


-------------------- MT STATUS ----------------------
55*H [B04232] 38000C #1 1:0 <08/21/1998> COMF/FILE000

7–18 8807 7391-006


Copying Files

Output from the PER MT command for a tape that is compressed. You can tell that the
tape is compressed because of the letter C that appears after the density 38000.

MT Display for a Compressed Tape on an Inappropriate Tape Unit


------------------ MT STATUS --------------------
55*H [B04232] 38000C #1 1:0 COMPRESSION MISMATCH,
CAN’T READ(SEE OL)

Output from the PER MT command for a compressed tape. This tape has been remounted
on a tape unit that does not support tape compression. The COMPRESSION MISMATCH
message warns you of this problem.

Copying a Compressed File from an Inappropriate Tape Unit


---Job-Task-Pri-Elapsed--- 1 WAITING ENTRIES --
5302/5304 50 39:29 *LIBRARY/MAINTENANCE
NO FILE DBBACK/FILE000 (MT) #1

One reason this message can occur is that the job attempts to copy a file from a
compressed tape that has been remounted on a tape drive that does not support
compression.

Locking the Tape


The LOCKEDFILE option in this statement protects the tape from being accidentally
purged or overwritten. If you attempt to apply the PG or SN command to the resulting
tape, a waiting entry such as the following appears:
---Job-Task-Pri---Elapsed------- 1 WAITING ENTRIES -----
6246/6246 80 :27 JOB PURGIT
MT28 CONFIRM PURGE CONF/FILE000 [950824] OK
OR DS

The LOCKEDFILE option also protects the tape from being overwritten by subsequent
COPY statements. A COPY statement automatically overwrites a destination tape if the
COPY statement specifies a serial number that matches the tape. However, if the tape
was created with the LOCKEDFILE option, the copy task becomes suspended with a
message such as the following:
---Job-Task-Pri---Elapsed------- 1 WAITING ENTRIES -----
6120/6121 50 :49 *LIBRARY/MAINTENANCE
CONF/FILE000 REQUIRES MT [950824] #1

To enable the copy to complete, you must enter a PG command to purge the tape, and
supply an OK response to the waiting entry for LIBRARY/MAINTENANCE.

Using Multireel Tape Sets


A multireel tape set consists of two or more tapes that were created by a single COPY
statement. The following pages describe how to

8807 7391-006 7–19


Copying Files

• Copy files to a multireel set, with or without specifying serial numbers.


• Identify the tapes in a multireel set as they are displayed by the PER MT system
command.
• Copy files from multiple reel sets.
• Copying to Multiple Reels (Omitting Serial Numbers)
COPY *= FROM DOC(PACK) TO JBACK;
#RUNNING 2013
#BOT 2014 (OPS)WFLCODE
#BOT 2015 *LIBRARY/MAINTENANCE
.
.
.
#2015 JBACK/FILE019 REQUIRES MT #2

A COPY statement, submitted in CANDE that copies more files than can fit on the
destination tape. The system creates a waiting entry that prompts you to mount another
tape. The continuation of data onto another tape is referred to as a reel switch. The system
performs as many reel switches as necessary to accommodate the amount of data being
copied.

At this point, you would mount another tape and purge it if it is not already a scratch tape.
Then you could use the following command to make the copy continue, writing this time
to the tape on MT 30:
5972 OU MT 30

Note: CANDE does not support the OU command, so you must enter it in MARC,
Operations Center, or at an ODT.

Copying to Multiple Reels (Specifying Serial Numbers)


COPY *= FROM DOC(PACK) TO JBACK(SERIALNO =
("JBACK1", "JBACK2", "JBACK3", "JBACK4"));

Copies files to the tape with the serial number JBACK1. If reel switches are necessary,
searches for the continuation reels under the serial numbers JBACK2, JBACK3, and
JBACK4.

This feature of the COPY statement is useful if you know that a copy will require multiple
tape reels, and you have mounted multiple tapes with the specified serial numbers in
advance.

7–20 8807 7391-006


Copying Files

Identifying the Tapes in a Multiple Reel Set

Serial number

You assign this identifier with SN commands. If you use a meaningful serial number
convention, you can identify the tapes by the serial numbers alone and disregard the other
elements of the display.

Tape name

This identifier is the same for all tapes in a set. The tape name was specified in the COPY
statement that created the tape set.

File number

Indicates which file appears at the start of the tape. This number corresponds to the order
of the files in the tape directory. This number usually increases from one reel to the next.

File continuation number

For a single file that continues across multiple reels, this number indicates the order of the
reels.

Thus, in this example, the first tape contains the first 18 files and the beginning of file 19.
The second tape contains more of file 19. The third tape contains the remainder of file 19,
files 20 through 38, and the beginning of file 39. The fourth tape begins with the remainder
of file 39.

8807 7391-006 7–21


Copying Files

Copying Files from Multiple Reel Sets


COPY *LDATA/FORBES FROM JBACK TO DBFAM(PACK);
#RUNNING 2045
#BOT 2046 (OPS)WFLCODE
#BOT 2047 *LIBRARY/MAINTENANCE
.
.
.
#2047 NO FILE JBACK/FILE019 (MT) #2

Copies a file from a multiple reel set without specifying which reel the tape is on. In this
example, the COPY statement was submitted in CANDE, and the requested file is not on
the first reel. After reading the first reel, the system displays a waiting entry that requests
you to mount the next reel.

When you mount the next reel, the copy request resumes automatically. The system
continues prompting you to mount the next reel until the correct one is mounted. Then
the system copies the requested file.

If you know in advance which reel the file begins on, you can start by mounting that reel
instead of the first reel of the set. Use the IL command to make library maintenance begin
with the reel you have mounted, even though it is not the first reel in the set.

Understanding Tape Directories


Each tape includes a tape directory listing all the files that the system attempted to copy to
that tape.

Displaying the Tape Directory


You can use the TDIR command to display or print tape directories. The following
command displays the directory of the tape mounted on unit 30:
TDIR SPO 30

Printing the Tape Directory


The following command prints the directory of the tape mounted on unit 30:
TDIR 30

Tape Directories for Multiple Reel Sets


In a multiple reel set, each tape has its own directory. Each directory lists the files that
remained to be copied when the system began that reel. A tape directory does not list a
file if the file is continued from a previous reel.

Suppose you want to determine the reel where a particular file begins. Compare the tape
directories for each reel, starting from the first reel. The file begins on the last reel whose
tape directory includes an entry for that file.

7–22 8807 7391-006


Copying Files

Tape Directory Entries for Files That Are Not on the Tape
Be aware that the tape might not include all the files listed in the directory if any of the
following situations occurred when library maintenance first created the tape:
• Library maintenance was unable to copy one or more of the requested files to the
tape. If you later try to copy one of the missing files from the tape, the system
generates the error discussed under “<file name> NOT ON <tape name>” later in
this section.
• Library maintenance performed a reel switch because not all the files would fit on the
tape. If you later try to copy one of the missing files from the tape, the copy request is
suspended with the message discussed under “NO FILE <file name> (MT)” later in
this section.
• Library maintenance was discontinued or interrupted by a halt/load while creating the
tape. If you later try to copy one of the missing files from the tape, the system
generates the error discussed under TAPE FILE MISSING later in this section.

Using Tape Directory Disk Files


When you are copying to tape, you can use the LIBMAINTDIR option to create a tape
directory disk file. This file is like a conventional tape directory, but has the following
advantages:
• Records the reel where each file is located on a multireel set.
• Includes only files that are actually on the tape. Conventional tape directories can
include files that are not on the tape. Refer to “Tape Directory Entries for Files that Are
Not on the Tape” earlier in this section.
• Enables the FILEDATA utility to generate a report including selected file attributes
such as CREATIONDATE.

Creating Tapes with Tape Directory Disk Files


COPY *OBJECT/= FROM SERV(PACK) TO BACK(LIBMAINTDIR);

Copies files to the tape named BACK, and creates a tape directory disk file.

Copying Files from Tapes with Tape Directory Disk Files


COPY *OBJECT/REPFORMAT FROM BACK TO SUPP(PACK);

Copies a file from the tape named BACK. Library maintenance automatically uses the tape
directory disk file, if one is available for this tape. Otherwise, Library Maintenance uses the
conventional tape directory located on the tape itself.

Rules for Multireel Sets

Suppose the tape is part of a multireel set, and a tape directory disk file exists for that set.
Library maintenance takes the following actions:

8807 7391-006 7–23


Copying Files

1. Examines the first reel and finds a reference to the location of the tape directory disk
file.
2. Reads the tape directory disk file.
3. Prompts you to mount the reel that contains the source file (*OBJECT/REPFORMAT).

If there is no tape directory disk file, Library maintenance reads each reel until it finds the
file. You might have to mount multiple reels. For each reel, you have to wait while it
searches through the entire reel.

Printing Tape Directory Disk Files


DIR FILENAMES: LIBMAINTDIR =
LIBMAINTDIR/BACK/19980223/CLE187, PRI

RUN *SYSTEM/FILEDATA
("FILENAMES: LIBMAINTDIR = LIBMAINTDIR/BACK/19980223/CLE187");

Prints the contents of the tape directory disk file created on February 23, 1998, for a tape
with the name BACK and the serial number CLE187.

DIR

Use this command if you are at an ODT.

RUN *SYSTEM/FILEDATA

Use this command if you are in a CANDE or MARC session.

PRI

Directs the output to a printer. If you omit this clause, the output displays at your screen
instead.

Removing Tape Directory Disk Files


Location

Tape directory disk files reside on the family specified by the DL LIBMAINTDIR form of the
DL (Disk Location) system command. Tape directory disk files have titles of the following
form:
LIBMAINTDIR/<tape name>/<date>/<serial number>

These files reside under the usercode of the WFL job. If the WFL job runs without a
usercode, the tape directory disk files are also nonusercoded (*) files.

Automatic Removal of Tape Directory Disk Files

The system automatically removes tape directory disk files when you reuse the
corresponding tapes for another purpose. For example, if you enter an SN (Serial Number)
or a PG (Purge) command, the following message appears in the Messages display:

7–24 8807 7391-006


Copying Files

MT <unit number> THIS TAPE VOLUME HAS A RESIDENT


'LIBMAINTDIR' TAPE DIRECTORY DISK FILE <file name>

Additionally, a job called PURGIT appears in the Waiting Entries display with the following
message:
MT <unit number> TO LEAVE THIS TAPE AS IS REPLY 'DS';
TO PURGE IT REMOVE THE 'LIBMAINTDIR' FILE OR REPLY 'OK'

If you enter a reply of OK, the system deletes the tape directory disk file.

Expanding Library Maintenance Tapes


You can expand the contents of an existing library maintenance tape by copying new files
to the end of the tape. However, this feature is available only for tapes that meet both of
the following criteria:
• The tape is mounted on a tape drive with fast access capability.
• There is a tape directory disk file for the tape. Refer to “Using Tape Directory Disk
Files” earlier in this section.

By expanding a tape, you make use of tape space that otherwise would be unused. As a
result, you might not have to use as many different tapes for a given purpose. However,
you must take precautions to prevent ambiguities in the names of files on the tapes.

Checking for Fast Access Capability


OL MT 33
.
.
.
UNIT HAS LOCATE FAST ACCESS CAPABILITIES

Displays label and path information for tape unit 33. If the response includes the message
shown here, then the unit has fast access capability.

Expanding an Existing Tape


COPY *OBJECT/= FROM SERV(PACK) TO BACK(LIBMAINTAPPEND = TOEND);

Appends files to the end of the existing library maintenance tape named BACK. Note that
• All existing files on the tape are retained.
• The tape directory on the tape does not reflect the new files. However, the tape
directory disk file does.
• If BACK is a multireel tape set, library maintenance adds the files at the end of the
final reel.
• If the new files do not all fit on the tape, library maintenance performs a reel switch
and writes to a new reel.
• If a new file has the same title as an existing file, the new file is added and the old file
is retained. (The COPY and ADD statements both behave this way.) Thus, the

8807 7391-006 7–25


Copying Files

expanded tape can have two files with the same name. If you later attempt to copy
that file from the tape, library maintenance copies the first version of the file that it
finds.

Supplying the Serial Number of an Existing Reel


COPY *OBJECT/= FROM SERV(PACK) TO BACK
(LIBMAINTAPPEND = TOEND, SERIALNO = "OBJ33");

Appends files to the end of the existing library maintenance tape with the name BACK
and the serial number OBJ33. For a multireel set, you can supply the name and serial
number of any single reel in that set. Library reads the start of the reel to find the name of
the tape directory disk file, and then prompts you to mount the final reel if necessary.

Supplying Serial Numbers for Expansion Reels


COPY *OBJECT/= FROM SERV(PACK) TO BACK
(LIBMAINTAPPEND = TOEND,
SERIALNO = ("OBJ33","EXT01","EXT02","EXT03"));

COPY *OBJECT/= FROM SERV(PACK) TO BACK


(LIBMAINTAPPEND = TOEND,
SERIALNO = (,"EXT01","EXT02","EXT03"));

These statements serve a similar purpose. Each appends files to the end of the existing
library maintenance tape named BACK. Each statement specifies three serial numbers to
use for expansion reels: EXT01, EXT02, and EXT03.

The difference between these statements is that the first statement specifies the serial
number of an existing reel, OBJ33. The second statement specifies only a comma (,) for
this reel, with the result that library maintenance uses only the tape name BACK to locate
the reel. If you omit the leading comma, library maintenance assumes that EXT01 is the
serial number of an existing reel, rather than an expansion reel.

Preventing Duplicate File Names


COPY *OBJECT/= AS #TIMEDATE(YYYYMMDD)/OBJECT/=
FROM SERV(PACK) TO BACK(LIBMA INTAPPEND =
TOEND, SERIALNOL= "OBJ33");

Appends files to a tape, and prefixes the files with the current date. This method helps
ensure that none of the new files on the tape has the same title as any of the old files. This
method works if you copy files to this tape no more than once a day.

Advanced Features
The following pages explain how to
• Assign task attributes to the copy request.
• Improve copy efficiency with the BLOCKSIZE option.
• Ensure the accuracy of the copied data.

7–26 8807 7391-006


Copying Files

• Specify an individual disk unit as the destination.


• Specify how errors are handled.

Assigning Task Attributes to the Copy


COPY (RBFAB)LDATA/= FROM DCOM(PACK) TO LCOM(PACK);
USERCODE = JAEGER / MYPW;
FAMILY DISK = DISK ONLY;

Copies files and assigns several task attributes to the copy request. The effects of these
attributes are as follows:
• USERCODE = JAEGER / MYPW
Causes the copy to run under the JAEGER usercode.
• FAMILY DISK = DISK ONLY
Overrides the effect of any FAMILY statement previously specified for the job as a
whole.

Improving Copy Efficiency with the BLOCKSIZE Option


COPY DAILY/AUDIT FROM DEVPK(PACK) TO DAUDIT(BLOCKSIZE=5400);

Copies a file from disk to tape with increased efficiency by specifying a BLOCKSIZE value.

Rules

The BLOCKSIZE assignment results in greatly reduced processor usage by the copy
request. However, the BLOCKSIZE assignment does not necessarily reduce the elapsed
time for the copy. Instead, BLOCKSIZE benefits other processes on the system by leaving
the processor free for their use.

The BLOCKSIZE assignment is most helpful for copies from disk to tape. You should
specify BLOCKSIZE for the tape destination, not the disk source. A BLOCKSIZE value of
5400 is a good, typical value for improving efficiency of copies to tape.

Ensuring the Accuracy of Copied Data


COPY & VERIFY (DESTIN)= FROM USERPK(PACK) TO DESTIN;

COPY & COMPARE (DESTIN)= FROM USERPK(PACK) TO DESTIN;

These statements serve similar purposes. Each statement copies files to a tape and
checks to ensure that the data is written correctly.

Rules

The VERIFY option and the COMPARE each help to ensure the accuracy of copied data.
You can use one option or the other, but not both.

8807 7391-006 7–27


Copying Files

The disadvantage of these options is that they cause the copy request to take longer than
it otherwise would.

You can use the following factors to decide between the VERIFY option and the
COMPARE option:

Factor Considerations

Speed
• Single destinations
VERIFY is faster than COMPARE. COMPARE can take up to three
times as long as a straight copy. VERIFY is slower than a straight
copy but faster than a COMPARE.
• Multiple destinations
COMPARE might be faster than VERIFY. For multiple destinations,
COMPARE compares all destinations simultaneously, whereas
VERIFY checks destinations one at a time.

Thoroughness VERIFY does more thorough checking than COMPARE, in the following
respects:
• Tape destinations
COMPARE checks only the contents of files. VERIFY additionally
checks the correctness of tape structures between files.
• Tape sources
If the tape was originally created with VERIFY, then VERIFY checks
the integrity of the data on the source tape as well as the accuracy of
the copy at the destination. By contrast, COMPARE ensures only the
accuracy of the copy at the destination.
Recopies If COMPARE discovers an error in the copy at the destination, the system
asks you whether to recopy the file or skip the file.
In contrast, the VERIFY option does not allow you to request a recopy if a
verify error occurs in a copy to tape. You can only skip the file or terminate
the whole copy request.
Type of tape drive For 1250 BPI (quarter inch) tape drives, you can use the VERIFY option but
not the COMPARE option. For other types of tape drives, you can use
either option.

Specifying Physical Disk Packs


Rationale

When you copy a file to a multipack disk family, the system might distribute portions of
the file across all the members of the disk family. Thus, if any disk unit in the family
crashes, you are likely to lose some of the data in the file.

7–28 8807 7391-006


Copying Files

You can use the SINGLEUNIT or FAMILYINDEX options to concentrate the destination file
on a single disk unit. This method makes it possible that the file can survive some disk
crashes intact. However, if the single disk unit holding the file crashes, you lose the entire
file. Thus, the SINGLEUNIT and FAMILYINDEX options do not eliminate the risk of data
loss; but these options convert the risk of partial data loss to a less likely risk of more
drastic data loss.

Caution
Neither the SINGLEUNIT nor the FAMILYINDEX option is a substitute for
backing up your files to a backup medium on a regular basis.

Example
COPY QDATA/UPDATE TO APT(PACK,SINGLEUNIT);

COPY QDATA/UPDATE TO APT(PACK,FAMILYINDEX=1);

These statements serve similar purposes. Each statement copies a file to a single disk unit
on a multipack disk family. The SINGLEUNIT option allows the system to choose which
disk unit to use. The FAMILYINDEX option specifies the index number of a particular disk
unit within a family.

Canceling the Effect of a FAMILYINDEX Assignment

You can use a FAMILYINDEX = 0 assignment to prevent the condition discussed under
(FAMILYINDEX <number>) SECTORS REQUIRED ON <family> later in this section.

Specifying How Errors Are Handled


COPY & WAITONERROR DAILY/AUDIT, SCHED/MONITOR,
ORDERS/LIST FROM DOC(PACK) TO LMAST(PACK);

COPY & DSONERROR DAILY/AUDIT, SCHED/MONITOR,


ORDERS/LIST FROM DOC(PACK) TO L MAST(PACK);

These statements handle errors using the following options:


• WAITONERROR
When an error occurs, a waiting entry appears. The operator can enter system
commands to control how the system responds to each error condition.
• DSONERROR
When an error occurs, the copy request terminates. The system purges any output
tapes previously created by the copy request, and erases any backup information that
was recorded in the archiving or cataloging subsystem.

8807 7391-006 7–29


Copying Files

If you do not specify either option, the system handles most copy errors by skipping the
file with the error and continuing to copy the remaining files.

Waiting Entries Display for WAITONERROR


?W
---Job-Task-Pri---Elapsed------- 1 WAITING ENTRY USER=PETRU ----
6437/6445 50 6:05 (PETRU) *LIBRARY/MAINTENANCE
PK185 ERROR REPORTED AND '& WAITONERROR' OPTION SELECTED

Displays the waiting entries in CANDE. The display shows a copy request suspended by
the WAITONERROR option.

Responding to a WAITONERROR Display


?6445 Y
Status of Task 6437/6445 at 16:55:00
Program name: *LIBRARY/MAINTENANCE
Priority: 50
Origination: D96A01/CANDE/1 (LSN 237)
MCS: SYSTEM/CANDE
Usercode: PETRU
Chargecode: M583
Stack State: Waiting on an event
RSVP: PK185 ERROR REPORTED AND '& WAITONERROR' OPTION SELECTED
Reply: OF,OK,DS
Display: PK185 (PETRU)TEMP/TEST4 NOT ON SERV
Displayed at 16:54:45

Displays the status of the LIBRARY/MAINTENANCE task in CANDE. You can use a ?Y
command such as this one to determine which file the system was unable to copy. The
next to the last line displays the error that occurred. You can respond to this situation with
any of the following actions:
• Make a note of the file that could not be copied, and enter the command ?6445 OF or
?6445 OK. Either command causes the copy request to skip to the next file.
• Cancel the remainder of the copy request by entering ?6445 DS.

Copy Results
The following topics explain how to
• Determine if the copy was successful.
• Determine which files were copied, by printing a report or using the job summary.

Determining if the Copy Was Successful


TASK T;
STRING ASTR;
BOOLEAN COPYDONE := FALSE;
DO
BEGIN
INITIALIZE (T);

7–30 8807 7391-006


Copying Files

COPY (MCGUIRE)OBJECT/= FROM DBFAM(PACK) TO ACMAST(PACK) [T];


IF T(TASKVALUE) = 0 THEN
COPYDONE := TRUE
ELSE
BEGIN
ASTR := ACCEPT("COPY FAILED. RETRY? YES OR NO");
IF LENGTH(ASTR) = 0 THEN
COPYDONE := TRUE
ELSE
IF (TAKE(ASTR,1) NEQ "Y") AND
(TAKE(ASTR,1) NEQ "y") THEN
COPYDONE := TRUE;
END;
END
UNTIL COPYDONE;

In this example, the COPY statement is placed inside a DO UNTIL loop. After the COPY
statement completes, this example checks the value of the TASKVALUE attribute. Library
maintenance sets TASKVALUE to a nonzero value if one or more files were not copied.
Library maintenance also returns a nonzero value if the copy is discontinued, or in the case
of an RSVP condition, if the failing action is not retried.

If TASKVALUE indicates that not all files were copied, then the operator is prompted to
enter an AX (Accept) system command indicating whether the copy operation should be
retried.

Determining Which Files Were Copied


WFL does not provide any method for the job itself to determine which particular files
were successfully copied. However, you can use the REPORT option or the
JOBSUMMARY attribute to print information about the success of each file copy.

Printing a Report
COPY & REPORT TEMP/1 AS SAVE/1, TEMP/2 AS BASIC/2,
TEMP/3 AS OTHER/3 FROM DBFAM(PACK) TO ACMAST(PACK);

Uses the & REPORT option to print a report of the files that are copied and any errors that
are encountered. Following is an example of this report:
PK412 (JASMITH)TEMP/3 NOT ON PACK
(JASMITH)TEMP/1 COPIED AS (JASMITH)SAVE/1 FROM DBFAM TO ACMAST
(JASMITH)TEMP/2 COPIED AS (JASMITH)BASIC/2 FROM DBFAM TO ACMAST

When you use this option, the system does not write FILE COPIED messages in the job
summary or system log.

Note: If you enter the COPY statement at a CANDE or MARC session, then by default,
the report will not print out until you end your session.

8807 7391-006 7–31


Copying Files

Errors in Generating the Report


#9346 'LIBMAINTREPORTER' PROCEDURE NOT AVAILABLE IN
'ARCHIVESUPPORT' LIBRARY; '& REPORT' WILL BE IGNORED

No report was generated because the ARCHIVESUPPORT library function has not been
defined or points to an old version of the ARCHIVESUPPORT library.

An operator or system administrator can remedy this problem with an SL (Support Library)
command that assigns the ARCHIVESUPPORT function to a current version of the
ARCHIVESUPPORT library. Following is an example of this command:
SL ARCHIVESUPPORT = *SYSTEM/ARCHIVESUPPORT ON PACK

Using the Job Summary


BEGIN JOB;
JOBSUMMARY = UNCONDITIONAL;
COPY TEMP/1 AS SAVE/1, TEMP/2 AS BASIC/2, TEMP/3 AS OTHER/3
FROM DBFAM(PACK) TO ACMAST(PACK);
END JOB

Copies files and generates a job summary. The job summary is a printout that includes
messages showing whether each file copy succeeded, along with other information. For
further information about job summaries, refer to Using the Job Summary.

Example Output
15:15:40 7421 MESSAGE: PK412 (JASMITH)TEMP/3 NOT ON DBFAM
15:15:41 7421 MESSAGE: (JASMITH)TEMP/1 COPIED AS
(JASMITH)SAVE/1 FROM DBFAM TO ACMAST
15:15:41 7421 MESSAGE: (JASMITH)TEMP/2 COPIED AS
(JASMITH)BASIC/2 FROM DBFAM TO ACMAST

Examples of file copy messages from the job summary.

Determining Why a Copy Failed


The following are some examples of messages that can occur when a copy fails, along
with explanations of possible causes for these messages

DSS INACTIVE
A copy request failed because the DSSSUPPORT system library was not active.

This error can occur when an NFT copy is restarted after a halt/load. Refer to “Ensuring
the Hosts Are Available” later in this section.

END-OF-FILE READING HDR1 LABEL <file name>


Refer to TAPE FILE MISSING later in this section.

7–32 8807 7391-006


Copying Files

<file name> NOT ON <family name>


PK412 (NGUYEN)TEMO/3 NOT ON PACK

This message can result from any of several causes. Consider the following possibilities

Brief Reason Explanation

Misspelling You misspelled the name of a file.


Usercode omitted You forgot to specify the usercode in the source file name. This is the
likely cause if the message mentions your own usercode, but the
source file is actually under another usercode.

Family substitution You forgot the effects of family substitution. This is the likely cause if
the message mentions a family name that was not specified in your
COPY statement. For a description of family substitution, refer to
Equating the Family Statement in Section 5, Running Tasks.
File not present The file you requested is not present at the source. To determine
whether the file is present, you can use a PD (Print Directory) system
command of the form
PD <file title>
In CANDE, you would use the FILE <file title> command instead of
PD.

File archived to tape The system is running cataloging or archiving, and the file is present
only in the tape library. (Cataloging and archiving are features that
enable the system to keep track of files that have been backed up to
tape.)
Security restrictions The job does not have access rights to the source file. The system
displays the <file name> NOT ON <family name> message rather
than reporting a security violation in this case. For information about
file access rights, refer to Section 15, Security.

System files The file is of a FILEKIND that cannot be copied. Examples are system
directory files, BADDISK files, and job description files.

<file name> NOT ON <tape name>


MT28 *BOOKS/PAYABLE NOT ON BKPAY

The job attempted to copy the file from a tape, and one of the following problems
occurred:

8807 7391-006 7–33


Copying Files

• The file was not present in the tape directory. Possibly you mounted the wrong tape
or misspelled the tape name.
• The requested filename was listed in the tape directory, but the file was not actually
present on the tape.
• This difference between the tape directory and the tape contents results if either of
the following events occurred while the COPY statement was creating the tape:
- Someone deleted the file from the source disk after the COPY statement started
executing, but before the COPY statement copied that particular file.
- An error occurred in the file copy, and the operator responded to the RSVP
message with an OF (Optional File), DS (Discontinue), or FR (Final Reel) system
command.

For information about tape directories, refer to Understanding Tape Directories earlier in
this section.

HOST UNKNOWN OR NOT NETWORKING


DSS:HOST UNKNOWN OR NOT NETWORKING: BOSTON1
DSS:TRANSFER FAILED. REISSUE REQUEST TO RESUME.

A copy request failed because the requested host was not available.

This error can occur when an NFT copy is restarted after a halt/load. Refer to “Ensuring
the Hosts Are Available” later in this section.

Security Violation
SECURITY VIOLATION @ (41432000)
PK185 FILENAME NOT ENTERED INTO DISK DIRECTORY (PEEL)JC/REPORT
(PEEL)JC/REPORT NOT COPIED TO ACCTPK

The job attempted to copy the file to someone else’s usercode. This action requires the
privileges discussed under COPY or ADD in Section 15, Security.

Following are examples of COPY statements that could cause this error.

Using the AS Clause


COPY JC/REPORT AS (PEEL)JC/REPORT FROM DEVPK(PACK);

Explicitly requests that a file be copied to usercode PEEL. This statement causes a
SECURITY VIOLATION error if the job runs under a nonprivileged usercode other than
PEEL.

Omitting the AS Clause


COPY (PEEL)JC/REPORT FROM DEVPK(PACK);

7–34 8807 7391-006


Copying Files

Because the AS clause is not specified, attempts to create the destination file under the
same usercode as the source file (that is, PEEL). This statement causes a SECURITY
VIOLATION error if the job runs under a nonprivileged usercode other than PEEL.

TAPE FILE MISSING


MT28 END-OF-FILE READING HDR1 LABEL *BOOKS/PAYABLE
MT28 TAPE FILE MISSING *BOOKS/PAYABLE

The system was searching for a file that was listed in the tape directory, and detected
missing endoffile labels. The END-OF-FILE and TAPE FILE MISSING messages occur
together in this case. Most likely one of the following happened while the tape was being
created:
• The system was halt/loaded.
• The WFL job was terminated by a DS (Discontinue) system command.

TASK IS NOT PRIVILEGED TO COPY THIS DIRECTORY


PK185 TASK IS NOT PRIVILEGED TO COPY
THIS DIRECTORY (MARTHA)TEMP/"=" ON DEVPK

A nonprivileged job attempted to copy an entire directory of files from another usercode.
This action violates system security rules.

To copy the files, you should do one of the following:


• Use a job with privileged status. For information about privileged status, refer to
Section 15, Security.
• Copy the files individually, rather than as a directory.

Handling Waiting Copy Requests


A variety of error conditions can occur in a copy. Most of these conditions do not require
operator intervention. However, you can change the way errors are handled with the
WAITONERROR and DSONERROR options, as described under Specifying How Errors
Are Handled earlier in this section.

Following are descriptions of some conditions that can suspend the job, even if the
WAITONERROR option is not set.

(FAMILYINDEX <number>) SECTORS REQUIRED ON <family>


PK79 (FAMILYINDEX 2) 1008 SECTORS REQUIRED ON APT;
OK TO IGNORE FAMILYINDEX (ACCT)TEMP/DEBIT

The system is attempting to copy an area of a file to a specific disk unit, in this case the
second member of the disk family. The system targets a specific disk member in the
family if either of the following conditions is true:

8807 7391-006 7–35


Copying Files

• The COPY statement specifies the FAMILYINDEX option or the SINGLEUNIT option
for a disk destination.
• The source file has a FAMILYINDEX file attribute value. Source files on disk or on
library maintenance tapes might have a FAMILYINDEX value. The system uses the
same FAMILYINDEX for the destination unless you override it in the COPY statement.

Responding to the Problem

The (FAMILYINDEX <number>) <number> SECTORS REQUIRED ON <family> message


occurs when the requested disk member is not present or is out of space. The system
asks your permission to copy the next file area to a different disk member on the same
family.

You can give your permission by entering <mix number> OK. However, you have to make
this response for each area of the file. For a long file, this could mean a lot of OK
commands.

Preventing the Problem


COPY QDATA/UPDATE FROM SERV TO APT(PACK,FAMILYINDEX=0);

Copies a file and ignores any FAMILYINDEX attribute value stored in the source file.
Instead, the FAMILYINDEX=0 assignment allows the system to assign file areas to any
disk members in the disk family.

NO FILE <file name> (MT)


---Job-Task-Pri---Elapsed------- 1 WAITING ENTRIES ---------
5303/5304 50 39:29 *LIBRARY/MAINTENANCE
NO FILE DBBACK/FILE000 (MT) #1

Indicates that the COPY request is waiting for a tape. This condition can occur for any of
the following reasons:
• You were deliberately copying from tape, but have not yet mounted the required tape.
The copy will resume when you mount the tape. In some circumstances, you might
have to use additional commands to direct the copy to use a particular tape or tape
unit. Following is one such command:
<mix number> IL MT <unit number>
• If the NO FILE message line ends with a number greater than 1, then you
attempted to copy from a multireel tape set. The file or files were not located
completely on this reel, and this system is prompting you to mount the next reel.
• You intended to copy from a disk family, but forgot to specify KIND = DISK for the
source. The system therefore attempted to copy from a tape, which is the default.
You should DS the job, fix the COPY statement, and submit it again.
• The job attempted to copy a file from a compressed tape that has been mounted on
a tape unit that does not support compression. To determine whether this is the
cause of the problem, refer to the PER MT display as described under
“Compressing Data” earlier in this section.

7–36 8807 7391-006


Copying Files

REQUIRES MT
---Job-Task-Pri---Elapsed---- 2 WAITING ENTRIES ----
3564\3674 50 7:59 (MFG) *LIBRARY/MAINTENANCE
DEBIT/FILE000 REQUIRES MT #1

The copy request is waiting to copy a file to a tape, for either of the following reasons:
• You intended to copy to a disk family, but forgot to specify KIND = DISK for the
destination. The system therefore attempted to copy to a tape, which is the default.
You should stop the job with a DS command, fix the COPY statement, and submit it
again.
• You were deliberately copying to tape, but have not yet mounted the required tape.
The copy will resume when you mount the tape. In some circumstances, you might
have to use additional commands to direct the copy to use a particular tape or tape
unit. Following is a sequence of commands that create a scratch tape on MT 30, and
direct the library maintenance task with mix number 3674 to use that scratch tape:
PG MT 30
3674 OU MT 30

Serial Number Requests


---Job-Task-Pri---Elapsed---- 1 WAITING ENTRY USER=JOSEPH --
* 6636\6815 50 :06 (MFG) *LIBRARY/MAINTENANCE
DEBIT/FILE000 REQUIRES MT [PARTS ] #1

The copy request is waiting to copy a file to a tape with a serial number of PARTS. Refer to
“Using a Serial Number for the Destination” earlier in this section.

SCRATCHPOOL Requests
---Job-Task-Pri---Elapsed---- 1 WAITING ENTRY USER=JOSEPH --
* 6636\6815 50 :06 (MFG) *LIBRARY/MAINTENANCE
DEBIT/FILE000 REQUIRES MT #1 SCRATCHPOOL=MFC

The copy request is waiting to copy a file to a tape with a SCRATCHPOOL value of MFC.
Refer to “Selecting from a Pool of Tapes” earlier in this section.

RECOPY REQUIRED
PK 64 RECOPY REQUIRED *CONTROL/DOCS

The system detected possible data corruption in the file being copied. This RSVP condition
is preceded by a library maintenance error message. Only some error conditions allow
recopying, such as those indicated by the following messages:
I/O ERROR DURING COPY
COMPARE ERROR
I/O ERROR DURING COMPARE

Enter one of the following responses:

8807 7391-006 7–37


Copying Files

Desired Effect Command and Details

Recopy the file <mix number> OK


Permits the file to be recopied. If the error
persists, the library maintenance procedure
repeats the error message and asks again
whether the file should be recopied.
Recopy and request a reel switch <mix number> OU <unit type> <unit number>
Causes library maintenance to recopy the file.
Immediately after starting the recopy
operation, library maintenance performs a reel
switch and requests a new tape volume and
unit. Copying then continues to that new
volume.

Note: In general, library maintenance


accepts the OU response only when errors
have occurred writing to a tape.

Continue the copy <mix number> BADFILE


• Causes library maintenance to continue
copying the file to disk. The resulting copy
of the file on disk will have some data
corruption. Library maintenance takes the
following additional steps:
• Renames the output file so that the file
name begins with the node BADFILE.
• Stores a summary of the errors in the
BADINFO file attribute.

Note: In general, library maintenance


accepts the BADFILE response only when
errors have occurred reading from a tape
while copying from tape to disk.

Skip the file <mix number> OF


Prevents the file from being recopied. The
library maintenance procedure continues with
the next file.

Skip copies to this destination <mix number> FR


Prevents any more files from being copied to
this destination. If there are no other
destinations, the library maintenance program
terminates; otherwise, it continues copying to
the other specified destinations.

7–38 8807 7391-006


Copying Files

Desired Effect Command and Details

Terminate the copy request <mix number> DS


Terminates the library maintenance process.
The file in question and any other files that
were to be copied are not copied. Any files
already copied remain unless the
DSONERROR option was used.

Copying Files Between Hosts


The COPY statement includes a number of options that enable you to copy files between
hosts in a network. The following pages explain these topics:
• File transfer services
• Local hosts and remote hosts
• Monitoring progress of file transfer tasks

File Transfer Services


A copy statement that copies files between hosts is referred to as a file transfer request.
File transfer requests are executed by system software programs called file transfer
services. There are several different file transfer services. This book discusses only the
following two:
• Native File Transfer (NFT)
• This is the default file transfer service. NFT copies files between MCP servers
connected by a BNA network. For details about how to use this service, refer to
Copying Files with Native File Transfer (NFT) later in this section.
• File Transfer Protocol (FTP)
This file transfer service copies files across TCP/IP networks, such as the Internet. For
details about how to use this service, refer to Copying Files with File Transfer Protocol
(FTP) later in this section.
The remaining file transfer service is Host Services File Transfer. For information about
this service, refer to the Distributed Systems Services Operations Guide.

Local Hosts and Remote Hosts


In this book, the host where the COPY statement is entered is referred to as the local
host. Any other hosts involved in the copy request are referred to as remote hosts.

COPY statements can copy files in various directions:

8807 7391-006 7–39


Copying Files

• From the local host to the remote host. In this case, the source file is on the local host
and the destination file is created on the remote host.
• From the remote host to the local host. In this case, the source file resides on the
remote host, and the destination file is created on the local host.
• From one remote location to another. In this case, the WFL job is initiated at the local
host, the source file resides on a remote host, and the destination file is created at that
remote host or a different remote host. This capability is available only for NFT copies.

Monitoring Progress of File Transfer Tasks


Copies between hosts initiate a task called FILE/TRANSFER instead of
LIBRARY/MAINTENANCE. FILE/TRANSFER in turn initiates one or more tasks with
various names.

To determine the status of a copy, enter a HI command for the first task initiated by
FILE/TRANSFER. The following examples show the use of the HI command to monitor file
transfers initiated in CANDE sessions.

NFT Copies
COPY = FROM SERV(PACK) TO PACK(HOSTNAME=LA001);
#RUNNING 3478
#BOT 3479 (APPS)WFLCODE
#BOT 3485 *FILE/TRANSFER
#BOT 3489 (APPS)NFT/TO/MPA15C

?3489 HI
#3489 DSS:COPYING (APPS)W/DAILY/XPS/CYCLE ON SERV AS
(APPS)W/DAILY/XPS/CYCLE ON PACK FROM SF001 TO LA001
#3489 DSS:ELAPSED TRANSFER TIME 00:29 = 75% TRANSFERRED

Displays the current status of an NFT copy task in CANDE. The HI command uses the mix
number of the first task initiated by FILE/TRANSFER.

FTP Copies
COPY 'counter.dat' AS COUNTER/DAT (FTPSITE = "MAPIN CCSYMBOL"),
FROM DISK(PACK,DOMAINNAME="users.omega.com",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);
#RUNNING 3612
#BOT 3613 (JOSEPH)WFLCODE
#BOT 3614 *FILE/TRANSFER
#BOT 3615 (JOSEPH)FTP/FILE/TRANSFER/FROM/DNS_HOST
#BOT 3616 (JOSEPH)FTP/HELPER/FOR/BATCH/CLIENT/MIX_3615

?3615 HI
#3615 FTP: Copying counter.dat as COUNTER/DAT ON SERV
from "USERS.OMEGA.COM." to LA001
#3615 FTP: 2 octets transferred in 0.1 seconds (17.8 /
second)

Displays the current status of an FTP copy task in CANDE. The HI command uses the mix
number of the first task initiated by FILE/TRANSFER.

7–40 8807 7391-006


Copying Files

Copying Files with Native File Transfer (NFT)


Native File Transfer (NFT) copies files between MCP servers connected by a BNA
network. NFT is the default file transfer service, so you do not have to do anything special
to request it.

In general, NFT COPY statements look exactly like normal COPY statements, except that
a HOSTNAME option is added to the FROM clause, the TO clause, or both.

The following pages explain these topics:


• Copying to a remote host
• Copying from a remote host
• Copying files between remote hosts
• Copying to and from tapes
• NFT copy restarts

Copying to a Remote Host


COPY (DODD)OBJECT/= FROM REL32(PACK) TO
STOR(PACK, HOSTNAME = LAHUB);

Copies a directory of files from the local host to a disk family on the remote host LAHUB.

Copying from a Remote Host


COPY (DODD)OBJECT/CRUNCHER, (DODD)REPORT/= FROM
STOR(PACK, HOSTNAME = LAHUB)TO REL32(PACK);

Copies a file and a directory from the remote host LAHUB to the local host.

Copying Files Between Remote Hosts


COPY (JCOM)INDEX/DATA AS INDEX/DATA
FROM USERPK(PACK,HOSTNAME=LONDON1)
TO PACK(PACK,HOSTNAME=PARIS4);

Copies a file from host LONDON1 to host PARIS4. This statement could be entered at
some third host, for example, ZURICH. In this case, ZURICH is said to be the local host
and is copying files between two remote hosts (LONDON1 and PARIS4).

Copying from Tapes on Remote Hosts


COPY = FROM MYTAPE(SERIALNO="DBK009",
HOSTNAME = LAHUB) TO DBFAM(PACK);

Copies all files from a tape at host LAHUB with serial number DBK009. The files are
copied to DBFAM disk family at the local host.

8807 7391-006 7–41


Copying Files

Copying to Tapes on Remote Hosts


COPY (JENNY)RECAP/= FROM SERV(PACK) TO
RECAP(SERIALNO="JN33", HOSTNAME = GENEVA1;

Copies files from (JENNY)RECAP/= on SERV family. The files are copied to a tape with
serial number JN33 at host GENEVA1.

Copying between Tapes on Remote Hosts


COPY (JENNY)RECAP/= FROM MYTAPE(SERIALNO="DBK009",
HOSTNAME = LAHUB) TO RECAP(SERIALNO="JN33", HOSTNAME = GENEVA1);

Copies files from a tape at host LAHUB to a tape at host GENEVA1. This statement could
be entered at some third host, for example TORONTO. In this case, TORONTO is said to
be the local host and is copying files between two remote hosts (LAHUB and GENEVA1).

NFT Copy Restarts


If a WFL job is terminated by a system halt/load, the system automatically resubmits the
job after a halt/load. This topic is discussed in Section 17, Designing Jobs for Restarts.

If the WFL job was performing a COPY statement at the time of the halt/load, then the
system executes the COPY again. In some cases, the system is able to save time by
skipping files that were copied before the halt/load. In the case of NFT copies, the system
can even resume the copying in the middle of a disk file. (However, the latter capability
does not apply to tape files.)

You do not have to include anything special in the COPY statement to request a restart.
However, you can take certain measures to
• Ensure that the hosts are available.
• Restart copying from the beginning.
• Cleanup leftover recovery files.

Ensuring the Hosts Are Available


Rationale

After a halt/load, it might take some time for the system to reestablish connections to all
the other hosts in the network. If the copy restarts before the required host is available,
the file transfer fails with a message like the following:
DSS:HOST UNKNOWN OR NOT NETWORKING: BOSTON1

After a halt/load, it might also take some time for the system to activate the
DSSSUPPORT system library. This library must be active for the NFT service to work. If
an NFT copy is restarted before DSSSUPPORT is active, the file transfer fails with the
following message:
DSS INACTIVE

7–42 8807 7391-006


Copying Files

To prevent these problems, you can include code in the WFL job to delay the restart until
DSSSUPPORT and the remote hosts are ready. Following is an example that uses an
ACCEPT function to accomplish this goal.

Requesting an Operator AX
ON RESTART,
ACCEPTSTR := ACCEPT
("Enter AT BOSTON1 TD. Enter AX if BOSTON1 replies");
COPY GETNOTES/BARBBEA FROM DOC37(PACK)
TO PACK(HOSTNAME=BOSTON1);

The ON RESTART statement leads to the following sequence of events:


1. If the job is interrupted by a halt/load, the ACCEPTSTR assignment suspends the job.
The job appears in the waiting entries display with the RSVP message specified in the
ACCEPT statement.
2. At that point, the operator sends a simple operator command to the remote host. If
DSSSUPPORT is active and the remote host is available, the TD command displays
the date and time at the remote host. Following is an example of the output:
*** REPLY FROM BOSTON1 ***
The date is Thursday, September 5, 1997 (1997248)
The time is 11:43:32 Eastern Daylight Time (PDT)
Note: NW (Network Prefix) commands can return replies from a remote host even if
DSSSUPPORT is not active. Therefore, do not use NW commands to determine if
NFT copies are ready to be restarted.
3. When the host is available, the operator enters a <mix number> AX command.
The job resumes execution and restarts the COPY statement.

Restarting from the Beginning


Rationale

Suppose that the contents of the source file or source directory are likely to change
between the time the file transfer is first submitted and the time the file transfer is
restarted. The system automatically recopies a file from the beginning if the file was in the
middle of being copied, and the source file contents changed before the restart. However,
the restarted copy does not
• Recopy source files that changed after being completely copied.
• Copy files that were added to the source directory after the original copy requests
started.

If you want to ensure that the entire copy request restarts from the beginning, you can use
the FROMSTART option to achieve this effect. For example, if a file is added to the
DAILY/TRANS/= directory after the halt/load and before the job restart, the FROMSTART
option ensures that the new file is copied.

8807 7391-006 7–43


Copying Files

Example
COPY [FROMSTART] DAILY/TRANS/= FROM DOC37(PACK)
TO PACK(HOSTNAME=LAHUB);

If the file transfer request is interrupted and restarted, the file transfer begins again from
the start. Any files that were already copied are copied over again.

Removing Old NFT Recovery Files


Rationale

NFT recovery files sometimes accumulate on disk from old file transfer requests
submitted by previous WFL jobs or COPY commands that never completed. You should
take measures to delete those recovery files periodically.

The NFT recovery files are stored at the local host in the following directory:
(<WFL job usercode>)FTRECOVERY/= ON DISK

If family substitution is in effect, the files are stored on the primary substitution family
instead of DISK.

Example
IF NOT MYSELF(RESTARTED) THEN
REMOVE FTRECOVERY/=;
COPY = FROM SERV(PACK) TO ARCH(PACK,HOSTNAME=LIMA);

Removes old recovery files before performing a new NFT request.

IF NOT MYSELF(RESTARTED)

Checks whether the current WFL job has been restarted after a halt/load. If the job was
restarted, the job should not remove recovery files because they can be useful in
restarting the copy request. If the job was not restarted, then any recovery files are
probably old and can be removed safely.

REMOVE FTRECOVERY/=;

Removes all files in the directory where NFT recovery files are stored.

Note that this statement can remove recovery files from other WFL jobs and COPY
commands, if the copy requests were submitted under the same usercode and with the
same family substitution as the current job. If such copy requests are later restarted after
the recovery files are removed, the copy requests execute from the beginning just as if the
FROMSTART option had been used.

7–44 8807 7391-006


Copying Files

Copying Files with File Transfer Protocol (FTP)


File Transfer Protocol (FTP) enables you to transfer files across the Internet or other TCP/IP
networks. The WFL COPY statement includes a number of options specifically for FTP
copies.

Note: The following pages distinguish between two types of hosts:


• MCP server
The MCP environment of any ClearPath MCP system.
• Foreign host
A system that is not an MCP server. A foreign host could be a completely separate
system, or it could be a separate server within a ClearPath MCP system. An example
is the Windows NT server in a ClearPath MCP with Windows NT system.

The following pages describe how to copy files from:


• Foreign hosts to the local MCP server
• Local MCP server to foreign hosts
• Local MCP server to a remote MCP server
• Remote MCP server to the local MCP server

The following pages discuss only the most typical options for FTP copies. For information
about other options, and further details about any of the topics discussed here, refer to the
TCP/IP Distributed Systems Services Operations Guide.

Foreign Host to Local MCP Server FTP Transfers


COPY 'prism.c' AS SYMBOL/PRISM (FTPSITE = "MAPIN CCSYMBOL")
FROM DISK(PACK,DOMAINNAME="users.omega.com",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);

Copies a file from a foreign host to the local MCP server. The individual elements of this
example are explained on the following pages under these headings:
• Specifying the foreign file
• Specifying the local file
• Copying multiple files
• Controlling input mapping
• Controlling line breaks
• Preserving the original record format
• Specifying the foreign disk family
• Specifying the foreign host
• Specifying the foreign usercode

8807 7391-006 7–45


Copying Files

Specifying the Foreign File


COPY '/htdocs/users/prism.c' AS SYMBOL/PRISM
(FTPSITE = "MAPIN CCSYMBOL")
FROM DISK(PACK,DOMAINNAME="users.omega.com",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);

Copies the file prism.c from the path /htdocs/users.

Rules

Specify the source file name using the exact spelling and casing that are expected on the
foreign host.

Enclose the file name in single quotes (’). The single quotes denote a universal file name,
which follows different rules from an MCP server file name.

Note: Do not enclose the file name in double quotes (″). Rather than denoting a universal
file name, double quotes indicate a file name node that can include special characters.

For UNIX paths, use forward slashes (/) between the directory levels. For DOS or
Windows paths, use backward slashes (\) between the directory levels.

If you omit a path, the file is copied from the default working directory for the user ID.

Do not use wildcard characters (*). You can copy only one file at a time.

Specifying the Local File


COPY 'prism.c' AS SYMBOL/PRISM (FTPSITE = "MAPIN CCSYMBOL")
FROM DISK(PACK,DOMAINNAME="users.omega.com",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);

Rules

Use a file name that follows the standard MCP server syntax for file names.

Do not specify directories (for example, SYMBOL/=). You can copy only one file at a time.

Copying Multiple Files


COPY 'prism.c' AS SYMBOL/PRISM (FTPSITE = "MAPIN CCSYMBOL"),
'prdf.c' AS SYMBOL/PRDF (FTPSITE = "MAPIN CCSYMBOL"),
'prrpt.c' AS SYMBOL/PRRPT (FTPSITE = "MAPIN CCSYMBOL")
FROM DISK(PACK,DOMAINNAME="users.omega.com",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);

Copies three files.

Rules

If you copy multiple files, you must specify transform attributes separately for each file.
(FTPSITE is an example of a transform attribute.)

7–46 8807 7391-006


Copying Files

Controlling Input Mapping


COPY 'prism.c' AS SYMBOL/PRISM (FTPSITE = "MAPIN CCSYMBOL")
FROM DISK(PACK,DOMAINNAME="users.omega.com",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);

Creates a destination file of FILEKIND = CCSYMBOL, which is appropriate for C


programming language source files. The system assigns file attributes that are typical for
CCSYMBOL files.

Concepts

On foreign hosts, files are often ASCII byte streams. Such files can have variable-length
records and embedded tab characters or other formatting codes.

On an MCP server, each file has a record layout defined by the FILEKIND attribute. There
are dozens of FILEKIND values, and each one implies a particular fixed record length and
the position of the sequence number and mark id fields, if any. For an explanation of the
record layout implied by each FILEKIND value, refer to the File Attributes Programming
Reference Manual.

The COPY statement offers a large number of options for mapping foreign file structures
to MCP server file structures. The preceding example shows one of the simplest types of
mapping.

Controlling Line Breaks


COPY 'prism.c' AS SYMBOL/PRISM (FTPSITE = "MAPIN CCSYMBOL")
FROM DISK(PACK,DOMAINNAME="users.omega.com",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);

Creates a destination file of FILEKIND = CCSYMBOL. Folds any excessively long records
into two or more standard length records. The division is made at the last blank space
before column 72 (because 72 is the length of the text field in CCSYMBOL files).

Rules

Following are the possible values for FOLDING:

Value Meaning

BLIND Fold at the text field boundary. (Default)

TRUNCATE Discard the overflow data.


SPACE Fold the record at the last space character. If
none is found, perform a blind fold.
NONE Terminate the transfer if overflow is detected.

8807 7391-006 7–47


Copying Files

Note: If the file is a program source, the additional line breaks in the destination file
might violate the syntax expected by the compiler. When you attempt to compile the
program, the syntax error messages will draw your attention to the places where such
problems have occurred.

Preserving the Original Record Format


COPY 'prism.c' AS SYMBOL/PRISM
(FTPSITE = "MAPIN TEXT (FILEKIND = CDATA, RECORDLENGTH = 120)")
FROM DISK(PACK,DOMAINNAME="users.omega.com",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);

Creates a destination file of FILEKIND = CDATA with records 120 characters long. No
sequence number field or mark ID field is defined.

Rules

When you assign a FILEKIND of CDATA, you can change the record length to any value
you want. Use the RECORDLENGTH option if all the following conditions are true:
• You know that the source file contains records too long for standard FILEKIND values.
• You can identify a record length that is long enough to contain all the records.
• You do not want the system to add line breaks to force the data into a standard
FILEKIND.

Note: Text that extends beyond standard record lengths cannot be compiled by
MCP server compilers or edited in CANDE or the Editor.
You might still find it useful to create such files for use as data files by application
programs.

Specifying the Foreign Disk Family


COPY 'C:\htdocs\users\prism.c' AS SYMBOL/PRISM
(FTPSITE = "MAPIN CCSYMBOL")
FROM DISK(PACK,IPADDRESS="199.171.190.29",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);

Copies the file from the C: drive of a foreign host that runs the MSDOS or Windows
operating systems.

Rules

The system ignores the source family name (DISK in the above example), and determines
this information from the file name instead.

If the foreign host is a UNIX system, all disks available through the file system are mapped
to particular directories in a single tree structure. Thus, by specifying a path in the file
name, you implicitly also specify the disk unit. For an example that specifies a path in the
file name, refer to “Specifying the Foreign File” earlier in this section.

7–48 8807 7391-006


Copying Files

Specifying the Foreign Host


COPY 'prism.c' AS SYMBOL/PRISM (FTPSITE = "MAPIN CCSYMBOL")
FROM DISK(PACK,IPADDRESS="199.171.190.29",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);

COPY 'prism.c' AS SYMBOL/PRISM (FTPSITE = "MAPIN CCSYMBOL")


FROM DISK(PACK,DOMAINNAME="www.omega.com",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);

These statements are equivalent. The first specifies the remote host by its IP address. The
second specifies the remote host by its domain name.

Rules

If you have a domain name server on your network, you should be able to use either a
domain name or an IP address. If there is no domain name server, you must use an IP
address.

Specifying the Foreign Usercode


COPY 'prism.c' AS SYMBOL/PRISM (FTPSITE = "MAPIN CCSYMBOL")
FROM DISK(PACK,DOMAINNAME="www.omega.com",
USERCODE='jcom'/'mypass'/500421) TO SERV(PACK);

Copies the file after logging on to the foreign host with a user ID of jcom, a password of
mypass, and an account number of 500421.

Rules

Notes:
• Remember to use single quotes (’), not double quotes (″). The single quotes prevent a
value from being automatically uppercased.
• Remember to use a separate pair of single quotes for each element that needs them.
There can be up to three pairs of single quotes: one pair for the user ID, one pair for
the password, and one pair for the account number. For example, the following
assignment is incorrect:
USERCODE='jcom/mypass/500421'

If the host does not require an account number for logging on, you can omit the account
number clause. For example,
USERCODE='jcom'/'mypass'

Local MCP Server to Foreign Host FTP Transfers


COPY SYMBOL/PRISM AS 'C:\htdocs\users\prism.c'
FROM SERV(PACK)
TO DISK(PACK,DOMAINNAME="users.omega.com",
USERCODE='maxwell'/'kjd'/109948);

Copies a file from the local host to the foreign host users.omega.com.

8807 7391-006 7–49


Copying Files

When no FTPSITE string is specified, the system takes default action in creating the
transmitted data stream from the source disk file. The default action sends the full record.
Trailing spaces and control fields, such as the sequence and ID fields, are not removed
before transmission. To discard the trailing spaces and control fields from the source file
record before the data is sent to the remote system, use the MAPOUT TRIM option,
which is discussed later in this section.

If the source file is of FILEKIND = CCSYMBOL, the system creates a destination file with
sequence numbers. However, if the source file is of FILEKIND = TEXTDATA, the system
creates a destination file without sequence numbers.

Rules

The following topics also apply for local MCP server to foreign host transfers:
• Specifying the foreign file
• Specifying the local file
• Specifying the foreign disk family
• Specifying the foreign host
• Specifying the foreign usercode

Trimming Output Data


COPY SYMBOL/PRISM AS 'prism.c'
(FTPSITE = "MAPOUT TRIM = ALL")
FROM SERV(PACK)
TO DISK(PACK,DOMAINNAME="users.omega.com",
USERCODE='maxwell'/'kjd'/109948);

Copies a file and discards trailing spaces, sequence numbers, and mark IDs from the
records.

Rules

Use the MAPOUT TRIM option to remove the trailing spaces in the text portion of the file
record and to remove the control fields from the file data before transmitting the file to the
remote system.

The MAPOUT TRIM option can have any of the following values:

Value Meaning

BLANKS FTP discards all trailing space characters in the text field.
If the sequence and mark ID fields are immediately to the right of the
text field, they are also discarded.

7–50 8807 7391-006


Copying Files

Value Meaning

SEQUENCE FTP discards the sequence field.


If the mark ID field is immediately to the right of the sequence field, the
mark ID field is also discarded.
ID FTP discards the mark ID field.

ALL FTP applies all of the trimming options; that is, FTP discards trailing
space characters, the sequence field, and the mark ID field.

NONE FTP does not apply trimming of the record. NONE is the default TRIM
value.

Local MCP Server to Remote MCP Server FTP Transfers


COPY REPORT/DATA AS '(YVES)REPORT/DATA ON ARCH'
(FTPSITE = "MAPOUT TRIM NONE;" &
"SITE = 'MAPIN TEXT (FILEKIND = CDATA, RECORDLENGTH = 90)'")
FROM ACCT(PACK)
TO DISK(PACK, DOMAINNAME = "www.omega.com",
USERCODE = 'YVES'/'PW2');

Copies a file from the local MCP server to a remote MCP server. The following pages
explain the following aspects of this example:
• Specifying the remote file name and disk family
• Specifying the remote host
• Specifying the remote usercode
• Controlling output mapping for the client
• Controlling input mapping for the server
• Changing the FILEKIND after the copy

Rules

If the local host and the remote host are connected by a BNA network, it is simpler to copy
the file using NFT instead of FTP. Refer to Copying Files with Native File Transfer (NFT)
earlier in this section.

Specifying the Remote File Name and Disk Family


COPY REPORT/DATA AS '(YVES)REPORT/DATA ON ARCH'
(FTPSITE = "MAPOUT TRIM NONE;" &
"SITE = 'MAPIN TEXT (FILEKIND = CDATA, RECORDLENGTH = 90)'")
FROM ACCT(PACK)
TO DISK(PACK, DOMAINNAME = "www.omega.com",
USERCODE = 'YVES'/'PW2');

Copies the file to the disk family ARCH on the remote host.

8807 7391-006 7–51


Copying Files

Rules

The destination family construct (DISK in the previous example) is ignored for FTP copies.
By default, the file is copied to the family named DISK. To specify a different destination
family, you must do both of the following:
• Enclose the destination file name in single quotes (’).
• Add an ON <family> clause to the destination file name.

Specifying the Remote Host


Using the Domain Name
COPY REPORT/DATA AS '(YVES)REPORT/DATA ON ARCH'
(FTPSITE = "MAPOUT TRIM NONE;" &
"SITE = 'MAPIN TEXT (FILEKIND = CDATA, RECORDLENGTH = 90)'")
FROM ACCT(PACK)
TO DISK(PACK, DOMAINNAME = "www.omega.com",
USERCODE = 'YVES'/'PW2');

Specifies the remote host by its domain name.

Using the IP Address


COPY REPORT/DATA AS '(YVES)REPORT/DATA ON ARCH'
(FTPSITE = "MAPOUT TRIM NONE;" &
"SITE = 'MAPIN TEXT (FILEKIND = CDATA, RECORDLENGTH = 90)'")
FROM ACCT(PACK)
TO DISK(PACK, IPADDRESS = "199.171.190.29",
USERCODE = 'YVES'/'PW2');

Specifies the remote host by its IP address.

Using the Host Name


COPY [FTP] REPORT/DATA AS '(YVES)REPORT/DATA ON ARCH'
(FTPSITE = "MAPOUT TRIM NONE;" &
"SITE = 'MAPIN TEXT (FILEKIND = CDATA, RECORDLENGTH = 90)'")
FROM ACCT(PACK)
TO DISK(PACK, HOSTNAME = OMEGA1,
USERCODE = 'YVES'/'PW2');

Specifies the remote host by its host name.

Rules

You can specify a remote MCP server by its domain name, IP address, or host name.

However, if you use the host name, then by default the system assumes this is an NFT
copy rather than an FTP copy. Errors such as the following can result:
TRANSFORMATION ATTRIBUTES ARE NOT SUPPORTED BY NFT;
NO TRANSFORMATIONS WILL BE DONE

7–52 8807 7391-006


Copying Files

To prevent this error, you can include the [FTP] clause in the copy statement, as shown in
the preceding example. In fact, you can include the [FTP] clause for any of the FTP copy
statements discussed in this section. When you do not include the [FTP] clause, the
system determines the type of copy by examining the other attributes of the COPY
statement.

Specifying the Remote Usercode


COPY REPORT/DATA AS '(YVES)REPORT/DATA ON ARCH'
(FTPSITE = "MAPOUT TRIM NONE;" &
"SITE = 'MAPIN TEXT (FILEKIND = CDATA, RECORDLENGTH = 90)'")
FROM ACCT(PACK)
TO DISK(PACK, DOMAINNAME = "www.omega.com",
USERCODE = 'YVES'/'PW2');

Uses the usercode YVES and password PW2 at the remote host.

Rules

Use an MCP server usercode and password for the first two nodes of the USERCODE
clause.

In many cases, you can leave the third node (the account number node) blank. However,
you need to supply an MCP server charge code if both the following conditions are true:
• The remote host requires a chargecode for your usercode, because the CHARGEREQ
usercode attribute is set.
• The remote host is unable to determine a default chargecode value to use, either
because the USEDEFAULTCHARGE usercode attribute is reset, or because the
CHARGECODE usercode attribute is null.

Controlling Output Mapping for the Client


COPY REPORT/DATA AS '(YVES)REPORT/DATA ON ARCH'
(FTPSITE = "MAPOUT TRIM NONE;" &
"SITE = 'MAPIN TEXT (FILEKIND = CDATA, RECORDLENGTH = 90)'")
FROM ACCT(PACK)
TO DISK(PACK, DOMAINNAME = "www.omega.com",
USERCODE = 'YVES'/'PW2');

Copies the file and retains trailing blanks, sequence fields, or mark ID fields.

Rules

By default, FTP would trim trailing blanks, sequence fields, and mark ID fields. This
example prevents the trimming, because the destination file is an MCP server file that
should contain all these elements.

8807 7391-006 7–53


Copying Files

Controlling Input Mapping for the Server


COPY REPORT/DATA AS '(YVES)REPORT/DATA ON ARCH'
(FTPSITE = "MAPOUT TRIM NONE;" &
"SITE = 'MAPIN TEXT (FILEKIND = CDATA, RECORDLENGTH = 90)'")
FROM ACCT(PACK)
TO DISK(PACK, DOMAINNAME = "www.omega.com",
USERCODE = 'YVES'/'PW2');

Causes the destination file to be created with FILEKIND = CDATA and record lengths of
90 characters.

FILEKIND = CDATA

This clause ensures that FTP preserves the existing sequence and mark ID values, instead
of creating new ones. You should change the FILEKIND of the destination file in CANDE
later on, as described under “Changing the FILEKIND after the Copy” later in this section.

RECORDLENGTH

For this value, you should specify a number equal to the length of the records in the source
file. You can determine this by looking at the record format descriptions for the FILEKIND
file attribute in the File Attributes Programming Reference Manual.

SITE

This option is actually part of the FTPSITE string. The FTPSITE string is broken across two
lines in this example because it is too long to fit on a single line. The ampersand (&)
character indicates that the second string is a continuation of the first.

FTP Clients and FTP Servers

The host where the COPY statement is entered is the FTP client. The other host is the FTP
server.

In the preceding example, the source file is on the FTP client, and the destination file is
created at the FTP server. This is because the remote host is specified in the TO clause.
The COPY statement “pushes” the file to the FTP server.

However, you could word a COPY statement to copy the file from the server to the client.
To do this, you would specify the remote host in the FROM clause. The COPY statement
“pulls” the file from the FTP server. For an example, refer to Remote MCP Server to Local
MCP Server FTP Transfers later in this section.

The FTPSITE option can include instructions for both the FTP client and the FTP server. To
indicate that instructions are for the FTP server, you must include them within the SITE
option. Outside of the SITE option, all the FTPSITE instructions apply to the FTP client.

Changing the FILEKIND after the Copy


TYPE (YVES)REPORT/DATA TO ALGOL

# WARNING: CURRENT TYPE (CDATA) HAS NO SEQUENCE FIELD; TYPE

7–54 8807 7391-006


Copying Files

ALGOL EXPECTS SEQUENCE NUMBERS IN COLUMNS 73-80.

This CANDE command changes the FILEKIND of the destination file from CDATA to
ALGOLSYMBOL. This step is necessary because the file was created with FILEKIND =
CDATA, as described previously under “Controlling Input Mapping for the Server.”

You can ignore the warning message. After the FILEKIND is changed, the original
sequence numbers from the source file are accessible in the destination file.

Remote MCP Server to Local MCP Server FTP Transfers


COPY '(YVES)REPORT/DATA ON ARCH' AS REPORT/DATA
(FTPSITE = "MAPIN TEXT (FILEKIND = CDATA, RECORDLENGTH = 90);"
& "SITE = 'MAPOUT TRIM NONE'")
FROM DISK(PACK, DOMAINNAME = "www.omega.com",
USERCODE = 'YVES'/'PW2')
TO ACCT(PACK);

Copies a file from another MCP server host to the local host.

After the file arrives, you must change the FILEKIND as described previously under
“Changing the FILEKIND after the Copy.”

This statement is the same one given under Local MCP Server to Remote MCP Server
FTP Transfers except that the position of some elements has been reversed. Thus,
• The DOMAINNAME and USERCODE values are specified in the FROM clause rather
than the TO clause.
• The remote family name of ARCH is specified in the source file name rather than the
destination file name.
• In the FTPSITE value, the position of the MAPIN and MAPOUT options is reversed.
The SITE option, which specifies values for the FTP server, now includes the
MAPOUT option rather than the MAPIN option.

Preserving File Attributes in MCP Transfers


When using mapping styles during a file transfer, FTP transfers files as either a TEXT or
IMAGE file. File attributes of the source file are discarded and new file attributes are
assigned to the destination file based on the mapping style. To retain the original attributes
of the source file and assign them to the destination file, use the transfer type MCPDATA
in the copy syntax.
COPY [FTP] USERFILES/= (FTPTYPE = MCPDATA)
FROM DISK TO DISK (HOSTNAME = MCP_HOST, USERCODE = AAA/BBB)

The copy statement above uses the MCPDATA transfer type to copy all files under the
USERFILES directory to the remote MCP host. The attributes of each file under the
directory are retained and assigned to the destination file at the destination host.

8807 7391-006 7–55


Copying Files

Copying a Directory of Files to or from a Remote Host


COPY [FTP] TEST/FILE/= FROM DISK(PACK)
TO DISK(IPADDRESS = "10.1.0.52",
USERCODE = MR1/IAX/500421)

or
COPY [FTP] ACCT/BILLING/= AS SALES/ACCT/BILLING/=
FROM DISK(HOSTNAME = SALES,
USERCODE = MRKT/JAMES/532014)
TO DISK(PACK)

Copies a directory of files to or from a remote host. When you specify ″/=″ in the file name
being copied, all the files in the directory are copied.

Rules

When the remote host is a Windows or Unix machine, you can copy all files under a
directory between the local and remote host. When you specify a directory on a remote
host, each node in the directory must exist before you enter the COPY command. If the
remote directory in the COPY command is XX/YY/ZZ/= - the folders XX, YY, and ZZ must
exist on the remote host.

When you perform a directory copy and a file within the directory has a nonstandard MCP
filename, the filename is converted following the rules used by the
NONNATIVE_FILENAMES option. This conversion takes place regardless of the setting of
this option. For more information on how nonstandard names are converted on the MCP,
refer to the TCP/IP Distributed Systems Services Operations Guide.

FTP Copy Restarts


After a halt/load, an FTP copy request might resume before the networking software and
connections are reestablished. If this problem occurs, the copy request fails. To learn how
to prevent this problem, refer to “Ensuring the Hosts Are Available” earlier in this section.

7–56 8807 7391-006


Section 8
Wrapping and Unwrapping Files

This section explains the following topics:


• Wrapping files
• Unwrapping files

Wrapping Files
You can use the WRAP statement to encode single or multiple files, a directory of files, a
container of files, or object files so that the files then can be transported to another
system. Once transported, the files can be returned to their original state by decoding
them using the UNWRAP statement.

If the DSONERROR option is specified, the wrap process aborts whenever it encounters
an error.

Using the WRAP Statement


A wrapped file created using the WRAP statement contains the file data and the original
disk file headers. A wrapped container is made up of one or more wrapped files. Both
wrapped files and containers can be transported across an open network and then created
again on another ClearPath MCP system using the UNWRAP statement. The original file
attributes for the file are maintained through both the wrap and unwrap operations.

Each type of wrap operation has unique characteristics to it. This section describes each
type of operation and its unique features.

Overview of Wrapped Files


You can wrap files into either
• Stand-alone files, which contain a single file with the file attribute information, the
verification information, and the data
• Container files, which contain many single wrapped files and a directory

8807 7391-006 8–1


Wrapping and Unwrapping Files

Wrapping Single Files


WRAP MYFILE

Wraps a stand-alone file.

Note: Do not use this simple form of the command because it is possible that copying
the wrapped file could overwrite the original file if that file is also present on the system.
You then would have to unwrap the file to restore the original file. Instead, use the AS
statement to give the wrapped file a different, unique name.
WRAP MYFILE AS NEWFILE

Wraps a stand-alone file and gives it a different name.

Wrapping Multiple Files


You can use the same command syntax to wrap several files in a single command
statement. Remember that a file is wrapped with its original name unless a new name is
specified using the AS statement. Each specified file must be separated by a comma.
WRAP MYFILE AS NEWFILE, YOURFILE AS NEW1FILE

Wraps the files MYFILE and YOURFILE as NEWFILE and NEW1FILE respectively.
WRAP MYFILE AS NEWFILE, YOURFILE

Wraps MYFILE as NEWFILE and YOURFILE as YOURFILE and overwrites the existing
version of YOURFILE because the AS statement is not used to specify a new name for the
wrapped file.

Wrapping Files to Families


When you wrap a file, the file is automatically written to your default directory. To wrap a
file to a different directory, use the TO statement and specify a destination family as
shown in the following example:
WRAP MYFILE TO DISK50

Wraps the file and writes it to a different directory. The AS statement is not necessary
because the file is written to a different disk where the file name is unique. Disk is always
the default device for the KIND value with the WRAP command because files cannot be
wrapped to tape. WRAP also used the standard family substitution rules as described in
Section 6, Managing Files.

Wrapping Directories of Files


You can wrap an entire directory of files. To wrap a directory specify the directory name
instead of a filename.
WRAP ZDIR/=

8–2 8807 7391-006


Wrapping and Unwrapping Files

Wraps a directory. The forward slash and equal sign (/=) are required when the directory
name is specified.

The same rules apply to wrapping directories that apply to wrapping files. If an AS
statement is not specified, the wrapped files replace the original files on the default disk
family. You also can use the TO statement to write the wrapped files to a different disk.
WRAP ZDIR/= AS BETA/=

Wraps all of the files in ZDIR and writes them to the directory BETA.
WRAP ZDIR/= AS BETA/= TO DISK50

Wraps all of the files in ZDIR and writes them to the directory BETA and then writes BETA
to a new disk.
WRAP ZDIR/= AS BETA/=, OLDDIR

Wraps multiple directories.


WRAP ZDIR/= AS BETA/=, OLDDIR/= TO DISK50

Wraps multiple directories and writes them to a new disk.


WRAP MYFILE AS NEWFILE, ZDIR/= AS BETA/=

Wraps the file MYFILE as NEWFILE and the directory ZDIR as BETA.

To wrap files that are not on your default disk, include the FROM statement in the
command syntax. The standard family substitution rules also apply with this form of the
command.
WRAP MYFILE AS NEWFILE FROM HOME TO DISK50

Wraps the file from the specified pack, specifies a new name for the file, and then writes
the wrapped file to a new destination.

Wrapping Files into Containers


You can wrap a group of files and directories into a single container file. The container file
can then be transmitted across the network to another host. The container file contains
the file data and any object files. All of the original file information is preserved in the
container file.

When the WRAP command specifies wrapping to a container file, the container file is
opened first and then the files and directories are wrapped and inserted into the container
file. The container file is created using the INTO statement in the WRAP command as
shown in the following example.
WRAP MYFILE AS NEWFILE INTO TANKER

Creates the container file TANKER and then wraps MYFILE with the new name
NEWFILE. Then writes the file NEWFILE to the container file TANKER.

8807 7391-006 8–3


Wrapping and Unwrapping Files

All of the files and directories specified before the INTO statement are included in the
container file unless the SEPARATELY statement is included. Multiple container files can
be specified in the same command.
WRAP MYFILE AS NEWFILE, ZDIR/= AS BETA/= INTO TANKER,
XFILE AS XXFILE, WORKING/= AS OLDDIR/= INTO STORE

Writes the first group of files and directories to the container file TANKER and the second
group to STORE.
WRAP MYFILE AS NEWFILE SEPARATELY, ZDIR/= INTO TANKER

Wraps MYFILE as NEWFILE but does not include the file in the container file TANKER.

Unwrapping Files
The unwrap process re-creates the original files from the data contained within the
wrapped files or containers. By default, the unwrap process also marks system files,
compilers, backup files, and code files as restricted. An appropriately privileged user can
override this behavior using the RESTRICTED volume attribute.

Unwrapping Single Files


The UNWRAP command reverses the actions of the WRAP command and generally used
the same command syntax and follows the same rules as the WRAP command.
UNWRAP MYFILE

Unwraps the wrapped file MYFILE and overwrites the file on the disk.
UNWRAP MYFILE AS NEWFILE

Unwraps the wrapped file MYFILE and writes the file as NEWFILE on the disk.

Unwrapping Directories of Files


To unwrap a directory of files, specify the directory name. If you include the AS statement
with the command, you can specify a new name for the unwrapped directory. Each
directory to be unwrapped in a single command statement must be separated by
commas.
UNWRAP ZDIR/=

Unwraps the directory.


UNWRAP OLDDIR/= AS ZDIR/=

Unwraps the directory OLDDIR and writes it as the new directory ZDIR.
UNWRAP OLDDIR/= AS ZDIR/=, XDIR/= AS WORKING/=

Unwraps the directories and writes each one as a new directory.

8–4 8807 7391-006


Wrapping and Unwrapping Files

Unwrapping Files to a New Disk


You can specify both a source and a destination volume to the unwrapped files in the
command statement. Use the FROM and TO statements in the command to specify the
current location of the file or directory and the new destination.
UNWRAP MYFILE TO DISK50

Unwraps MYFILE and then writes the file to a new location on DISK50.
UNWRAP MYFILE, ZDIR/= TO DISK50

Unwraps both the file and the directory and writes both to DISK50.
UNWRAP MYFILE, ZDIR/= FROM DISK50 TO WORKING

Unwraps both the file and the directory and writes both from DISK50 to the new directory
WORKING.
UNWRAP MYFILE, AS NEWFILE TO DISK50 (RESTRICTED=FALSE)

Unwraps the file with the new file name and writes the new file to the specified disk. The
Restricted option can only be used by a user with security administrator or privileged user
status.

Unwrapping Container Files


To unwrap container files include the OUTOF statement in the command syntax. The
OUTOF statement specifies the previously created container file that holds the necessary
files and directories.
UNWRAP MYFILE OUTOF TANKER

Unwraps the file MYFILE in the container file TANKER.


UNWRAP MYFILE, ZDIR/= OUTOF TANKER

Unwraps the file and the directory in the container file.


UNWRAP MYFILE AS NEWFILE, ZDIR/= AS WORKING/=
OUTOF TANKER, XFILE AS XXFILE,
OLDDIR/= AS TEST1/= OUTOF STORE

Unwraps multiple files and directories in the specified container files.


UNWRAP MYFILE AS NEWFILE, ZDIR/= AS WORKING/=
OUTOF TANKER TO PROD1

Writes the unwrapped container files to new locations.


UNWRAP MYFILE AS NEWFILE OUTOF TANKER FROM DISK50 TO PROD1

Writes the unwrapped container files to from the specified disk to the new locations.
UNWRAP MYFILE AS NEWFILE TO DISK50

8807 7391-006 8–5


Wrapping and Unwrapping Files

Unwraps the file using the new file name and writes the file to the specified disk.

Security Considerations
When a file is wrapped, the wrapped file inherits the usercode of the user who wrapped
the file unless a different usercode is used with the file name in the WRAP command
syntax.

This means that if you wrap a file and send it to a nonprivileged user, that user cannot
unwrap the file. Nonprivileged users can only unwrap files under their usercodes.
Therefore, remember to include the usercode of the nonprivileged user as part of the file
name.

Privileged users do not have this problem and can unwrap any files that are sent to them.

For further information about security features, especially the Infoguard


RESTRICTUNWRAP option and the WRAPNOWAIT system option, refer to the Security
Overview and Implementation Guide and the System Commands Reference.

8–6 8807 7391-006


Section 9
Printing Files

You can use WFL statements to print files or to change the ways that files are printed by
tasks. This section explains the following topics:
• Printing files and directories
• Specifying print defaults
• Choosing the printer destination
• Specifying the number of copies
• Specifying when printing takes place
• Controlling page layout
• Controlling headers and trailers
• Controlling banner pages

This section discusses only a few of the printing features that you can control in WFL. For
a complete discussion of printing, refer to the Print System User’s Guide and Printing
Utilities Operations Guide.

Printing Files and Directories


PRINT CUST/DATA;
PRINT TRANS/LOGS/=;

Initiates printing of the file CUST/DATA and of the printable files in the directory
TRANS/LOGS/=.

Specifying Print Defaults


BEGIN JOB RUNCUSTOM;
PRINTDEFAULTS = (DESTINATION = "PA150", AFTER = "18:00");

RUN OBJECT/DBINQ;
PRINTDEFAULTS = (AFTER = "14:00");

PRINT TRANS/LOGS/=;
PRINTDEFAULTS = (DESTINATION = "PA163");

END JOB

8807 7391-006 9–1


Printing Files

Specifies print defaults for the job, for a task, and for a PRINT statement.

The task OBJECT/DBINQ inherits the job-level print defaults, together with its own print
defaults. Where there are conflicts, the task-level print defaults take precedence. The
effect on the task is the same as a single task-level assignment of
RUN OBJECT/DBINQ;
PRINTDEFAULTS = (DESTINATION = "PA150", AFTER = "14:00");

The PRINT statement similarly inherits the job-level print defaults, together with its own
print defaults. The effect on the PRINT statement is the same as a single task-level
assignment of
PRINTDEFAULTS = (DESTINATION = "PA163", AFTER = "18:00");

Choosing the Printer Destination


Specifying a Printer
PRINTDEFAULTS = (DESTINATION = "PA150");

Directs the printout to the printer or group named PA150.

Specifying a Printer at Another Host


PRINTDEFAULTS = (DESTINATION = "LP8 AT DUBLIN2");

Directs the printout to the printer or group named LP8 at the host DUBLIN2.

Specifying the Number of Copies


PRINTDEFAULTS = (PRINTCOPIES = 3);

Specifies that three copies should be printed. The default value is 1.

Specifying When Printing Takes Place


By default, the system waits until a WFL job finishes, and then creates a single print
request including all the print files generated by the WFL job and its tasks. The system
places the print request in the print queue immediately, and prints the request when an
appropriate printer becomes available.

The PRINT statement is an exception to this general rule. By default, the system queues
output from PRINT statements immediately after completing the PRINT statement.

You can use the PRINTDISPOSITION and AFTER print modifiers to override these default
behaviors.

Specifying When the Print Request Is Created


PRINTDEFAULTS = (PRINTDISPOSITION = EOJ);

9–2 8807 7391-006


Printing Files

Specifies when the printer files created by this PRINT statement should be made into an
active print request.

Following are the effects you can achieve with various values of PRINTDISPOSITION.
Note that the CLOSE, DIRECT, DIRECTPS, FILEOPEN, NOW, and DONTPRINT values are
not valid with the PRINT statement.

To . . . Set to . . .

Generate a print request for each printer file as soon as the file CLOSE
is closed.

Route output directly to a printer (rather than placing the print DIRECT
request in a print queue).

Print the file directly on a periphal printer without creating a DIRECTLP


backup file or sending a print request to the Print System.
Automatically send a print request to the Print System when DIRECTPS
the file is opened without creating a backup file.

Cause the Print System to generate a print request when the NOW
file is opened, but a backup file is not created. Instead, all of
the I/O operations of the application are routed directly to the
Print System rather than to the physical I/O subsystem.

Cause the Print System to generate a print request when the FILEOPEN
file is opened. This allows the Print System to begin printing
the file while the file is still open, as long as a suitable device
is available and a complete block of records can be written.

Prevent printing, but save the printer file for possible later use. DONTPRINT
Generate a print request when the WFL job or CANDE or EOJ
MARC session terminates.

Generate a print request when the task terminates. EOT

Specifying When the File Should be Printed


PRINTDEFAULTS = (AFTER = "18:00");
PRINTDEFAULTS = (AFTER = "18:00 ON 09/14/1997");
PRINTDEFAULTS = (AFTER = "+4:00");
PRINTDEFAULTS = (AFTER = "15:00 ON +4");

Several different examples of ways to delay printing. The system does not mark the
request eligible for printing until the specified time or date.

Rules

Times are specified using a 24-hour clock. Thus, 18:00 means 6:00 p.m.

Dates are specified with the month first, then the day, then the year.

8807 7391-006 9–3


Printing Files

A plus sign (+) means that the following time or date should be added to the current time
or date. For example, if the current time is 13:00, then +4:00 requests a time of 17:00.

Controlling Page Layout


PRINTDEFAULTS = (PAGECOMP=
"PORTRAIT LM=1 RM=1 TM=.75 BM=.75 CPL=83 LPP=66");

Prints a file, using the following PAGECOMP options to control page layout:

PORTRAIT

Prints lines parallel to the shorter dimension of the page. To print lines parallel to the
longer dimension of the page, specify LANDSCAPE instead.

LM, RM, TM, BM

Specify the left margin, right margin, top margin, and bottom margin, respectively. The
default unit of measure is inches.

CPL and LPP

Characters per line and lines per page, respectively. The system uses this information to
select an appropriate font size.

Controlling Headers and Trailers


Rationale

Header and trailer pages are useful when you use a printer that is shared by many people.
These pages print at the start and end of each print request, and make it easy to separate
printer output that belongs to different users. However, if you are the only one using a
printer, you might want to save paper by suppressing the header and trailer pages.

Suppressing Headers and Trailers


PRINTDEFAULTS = (HEADER = SUPPRESSED, TRAILER = SUPPRESSED);

Suppresses printing of header and trailer pages.

For the opposite effect, to force printing of headers and trailers, you would assign a value
of UNCONDITIONAL to the HEADER and TRAILER options.

If you do not specify HEADER and TRAILER values in your job, then the printer
configuration determines whether header and trailer pages are printed. The printer
configuration is controlled with the PS CONFIG system command.

9–4 8807 7391-006


Printing Files

Controlling Banner Pages


Rationale

Banner pages, if you request them, are printed before each file in a print request. You can
specify the text to be printed on the banner pages.

Example
PRINTDEFAULTS = (BANNER = TRUE, NOTE = "NEWFILE");

Causes a banner page with the text NEWFILE to be printed before each file in a print
request.

Rules

The overall formatting of banner pages is controlled by the PS BANNER system command.
By default, the NOTE value is printed in large block letters, and the value is truncated if it
does not fit on a single line.

8807 7391-006 9–5


Printing Files

9–6 8807 7391-006


Section 10
Compiling Programs

When you write a program, you store the program statements in a file called the source
code file. You cannot run this file directly. Instead, you must use a compiler to read the
source code file and produce an executable file called the object code file. An object code
file is suitable for use in RUN statements.

You can submit compilations from WFL with the COMPILE statement.

Specifying the Source Code File


COMPILE OBJECT/REPORTGEN WITH COBOL85 LIBRARY;
COMPILER FILE CARD(KIND = DISK, TITLE = REPORTGEN);

Compiles a program, specifying the following equations for the source code file:

KIND = DISK

Overrides the default KIND value, which is READER.

TITLE = REPORTGEN

Specifies the title of the source code file.

Naming the Object Code File


COMPILE OBJECT/REPORTGEN ON DEVPK WITH COBOL85 LIBRARY;
COMPILER FILE CARD(KIND = DISK, TITLE = REPORTGEN);

Compiles a program, specifying OBJECT/REPORTGEN as the title for the object code file.
The object code file title can optionally include a family name, such as the ON DEVPK
clause in this example.

Choosing the Compiler


COMPILE OBJECT/REPORTGEN WITH COBOL85 LIBRARY;
COMPILER FILE CARD(KIND = DISK, TITLE = REPORTGEN);

Compiles a program, specifying COBOL85 as the compiler to use. You should choose the
compiler that matches the language of the source program. The following compilers are
available:

8807 7391-006 10–1


Compiling Programs

BINDER CC COBOL74
COBOL85 DCALGOL DMALGOL
FORTRAN77 NDLII NEWP
PASCAL RPG SORT

Choosing Whether to Save or Execute the Program


COMPILE OBJECT/REPORTGEN WITH COBOL85 LIBRARY;
COMPILER FILE CARD(KIND = DISK, TITLE = REPORTGEN);

Compiles a program, specifying that the resulting object code file should be saved. The
LIBRARY value is an example of a code file disposition. Following are the dispositions that
you can specify:

Disposition Effect

GO The object code file is executed but is not saved. If there are syntax
errors, execution does not occur. This is the default disposition if no
disposition is specified in the COMPILE statement.

LIBRARY The object code file is saved but is not executed. If there are syntax
errors, the object code file is not saved.
LIBRARY GO The object code file is saved and also executed. If there are syntax
errors, the object code file is not saved or executed.
SYNTAX The object code file is not saved and not executed. This disposition is
used to check the program for syntax errors only.

Using Compiler Control Options


Rationale

Each compiler supports a number of compiler control options. These options control many
different aspects of the compilation. You can include compiler control options in the source
code file. However, you might find it more convenient to specify these options as part of
the COMPILE statement.

The following pages use examples of compiling COBOL85 programs. However, the
options discussed here are also supported by most other compilers. For a description of
the options supported by each compiler, refer to the reference manual for the appropriate
programming language.

10–2 8807 7391-006


Compiling Programs

Example
COMPILE OBJECT/REPORTGEN WITH COBOL85 LIBRARY;
COMPILER FILE SOURCE(KIND = DISK, TITLE = REPORTGEN);
COMPILER DATA CARD
000000$ SET MERGE FREE ERRLIST
?

Shows the format for specifying compiler control options.

COMPILER FILE SOURCE

Specifies the program source file. This example equates SOURCE instead of CARD
because the CARD file is being used for another purpose.

COMPILER DATA CARD . . . ?

Supplies the contents of the compiler input file CARD. In this example, CARD is used to
store compiler options.

$ SET MERGE

Instructs the compiler to combine the contents of files CARD and SOURCE. If you do not
set this option, the compiler expects the entire program to be in the CARD file.

FREE ERRLIST

Included to show how multiple options can be set on the same line.

Note: For COBOL85 programs, compiler options should begin in column 7 of the data
deck. For most other languages, such as ALGOL, the options should begin in column 1 or
2.

Preventing COBOL85 Formatting Errors


COMPILE OBJECT/REPORTGEN WITH COBOL85 LIBRARY;
COMPILER FILE SOURCE(KIND = DISK, TITLE = REPORTGEN);
COMPILER DATA CARD
000000$ SET MERGE FREE
?

Uses the FREE option to prevent a COBOL85 syntax error. This error occurs, for example,
if you wrote the program in the Editor and began your program statements in the first
available column of each record. In reality, this is column 7, but in the Editor it is displayed
as the first column of the text field. The COBOL85 compiler expects only compiler options
to begin in column 7; program statements begin in column 8.

A program with statements in column 7 can compile successfully in CANDE, but receives
the following syntax error if you compile it in WFL:
ERROR: 901: SYNTAX ERROR; SYMBOL EXPECTED ----> IDENTIFICATION ***

You can prevent this error in either of two ways:

8807 7391-006 10–3


Compiling Programs

• By editing the program source in the Editor, and placing a blank character at the start of
the editable part of each record
• By using the FREE option in the WFL job, as shown previously

Controlling Program Listings and Error Listings


Printing a Program Listing and Error Messages
COMPILE OBJECT/REPORTGEN WITH COBOL85 LIBRARY;
COMPILER FILE SOURCE(KIND = DISK, TITLE = REPORTGEN);
COMPILER DATA CARD
000000$ SET MERGE FREE
?

Compiles a program and produces a printout of the program listing. The program listing is
produced because the LIST option is not specified, and this option defaults to SET.

Any syntax errors are flagged where they occur in the program listing.

Printing Error Messages Only


COMPILE OBJECT/REPORTGEN WITH COBOL85 LIBRARY;
COMPILER FILE SOURCE(KIND = DISK, TITLE = REPORTGEN);
COMPILER DATA CARD
000000$ SET MERGE FREE
000000$ RESET LIST
?

Suppresses the program listing. If errors are found, the compiler produces a printout of the
errors only. If there are no errors, then the compiler produces no printout.

Saving Error Messages to Disk


COMPILE OBJECT/REPORTGEN WITH COBOL85 LIBRARY;
COMPILER FILE SOURCE(KIND = DISK, TITLE = REPORTGEN);
COMPILER FILE ERRORFILE(TITLE = TEMP/ERRORS/COBOL85);
COMPILER DATA CARD
000000$ SET MERGE FREE ERRLIST
000000$ RESET LIST
?

Directs any error messages to a disk file.

ERRLIST

If syntax errors occur, creates a disk file storing the errors. You can use this error file in an
Editor session. First, get the source code file and start Editor. Then use the command
]LOAD E <file name> to load the error file. You can then skip forward to the next error with
the key combination Ctrl85 or the command ]+ERR. You can skip back to the previous
error with Ctrl-75 or ]-ERR.

COMPILER FILE ERRORFILE . . .

10–4 8807 7391-006


Compiling Programs

Specifies a title for the error file. The default title is ERRORS.

$ RESET LIST

Suppresses the program listing and the error listing, if any. The error listing is suppressed
because the ERRLIST option is set, and ERRLIST directs errors to a disk file instead of to a
printer file.

Producing Cross-Reference Information


COMPILE OBJECT/REPORTGEN WITH COBOL85 ON SYS441 LIBRARY;
COMPILER FILE SOURCE(KIND = DISK, TITLE = REPORTGEN);
COMPILER FILE ERRORFILE(TITLE = ERRORS/REPORTGEN);
COMPILER DATA CARD
000000$ SET MERGE FREE ERRLIST XREFFILES XREF
000000$ RESET LIST
?

Compiles a program and produces cross-reference information.

XREFFILES

Produces cross-reference files. You can load these files in the Editor, where they make it
possible to easily locate declarations and references to particular items in the program.
The files are titled
XREF/<source code file name>/DECS
XREF/<source code file name>/REFS

To use these files, get the source code file and start Editor. Then use the command ]LOAD
XREF <source code file name> to load the cross-reference files. You can then use the
command ]DEC <item name> to find the declaration of an item, or ]REF <item name> to
find references to the item.

XREF

Produces a printout of the cross-reference information, stating where various items are
declared and used in the program.

Using Patch Files


A patch file is a file that contains a set of changes to a larger, preexisting source code file.
You can create a patch file using the Editor. You can then pass a patch file and a source file
to the compiler. The compiler combines the two files and compiles the resulting program.

Under Using Compiler Control Options earlier in this section, a number of examples were
given that used a patch file and a source file. However, in these examples the patch file
was equated to a WFL data deck, and this deck was used to store only compiler options. A
patch file could be used instead to store changes to the program statements.

8807 7391-006 10–5


Compiling Programs

Example
TASK PT;
RUN SYSTEM/PATCH [PT];
FILE TAPE(KIND = DISK, TITLE = REPORTGEN);
FILE PATCH(KIND = DISK, TITLE = PATCH/RP/MERGED);
DATA CARD
$# PATCH INPUT
$.COBOL
000000$SET MERGE FREE
000000$# FIX HEADERS BUG
000000$.FILE PATCH/RP/FIXHEADERS
000000$# NEW FEATURE REQUEST 1
000000$.FILE PATCH/RP/ENHANCE1
?

IF PT(TASKVALUE) NEQ 1 THEN


ABORT "BAD SYSTEM/PATCH RUN";

COMPILE OBJECT/REPORTGEN WITH COBOL85 LIBRARY;


COMPILER FILE CARD(KIND = DISK, TITLE = PATCH/RP/MERGED);
COMPILER FILE SOURCE(KIND = DISK, TITLE = REPORTGEN);

Uses SYSTEM/PATCH to specify options for the compile and to combine two patches
together. Then compiles the program using the combined patch file,
PATCH/REPORTGEN/MERGED.

Explanation of SYSTEM/PATCH Run


• FILE TAPE
The program source file that is being patched against.
• FILE PATCH
The combined patch file that SYSTEM/PATCH will create.
• DATA CARD
Replaces the patch file CARD. This data deck can store a complete patch. However, in
this job the deck is used simply to hold some commands for SYSTEM/PATCH and the
COBOL85 compiler. Commands for SYSTEM/PATCH start in column 1 and begin with
prefixes such as $. or $#.
• $# PATCH INPUT
Notifies SYSTEM/PATCH that a patch is beginning. The $# characters identify the start
of the new patch. The text PATCH INPUT is an example of a comment that can say
anything you want.
• $.COBOL
Notifies SYSTEM/PATCH that the patch records are in COBOL format, which begins
with a six-digit sequence number.
• $SET MERGE FREE
Notifies the COBOL85 compiler to set the options MERGE and FREE. This statement
becomes part of the combined patch.

10–6 8807 7391-006


Compiling Programs

• $# FIX HEADERS BUG


Announces the beginning of a new patch, and describes the purpose of the patch with
the comment HEADERS BUG.
• $.FILE PATCH/RP/FIXHEADERS
Specifies an additional patch file. If patches request conflicting changes, each patch
takes precedence over the patches that precede it.
• $# NEW FEATURES REQUEST 1
Announces the beginning of a new patch, and describes the purpose of the patch with
the comment NEW FEATURES REQUEST 1.
• $.FILE PATCH/RP/ENHANCE1
Specifies an additional patch file.
For a complete description of SYSTEM/PATCH, refer to the System Software Utilities
Operations Reference Manual.

Explanation of Task Variable Usage

IF PT(TASKVALUE) NEQ 1 . . .

Checks whether the SYSTEM/PATCH run was successful. If the run is successful,
SYSTEM/PATCH sets its TASKVALUE to 1.

Explanation of Compilation
• COMPILER FILE CARD(KIND = DISK, TITLE = PATCH/RP/MERGED);
Uses the combined patch created by SYSTEM/PATCH as the patch for the compile.
• COMPILER FILE SOURCE(KIND = DISK, TITLE = REPORTGEN);
Specifies that the source file for the compile is named REPORTGEN.

Using Task and File Equations

Applying to Compilation or Code File


COMPILE OBJECT/REPORTGEN WITH COBOL85 LIBRARY;
COMPILER FILE CARD(KIND = DISK, TITLE = PATCH/RP/MERGED);
COMPILER FILE SOURCE(KIND = DISK, TITLE = REPORTGEN);
COMPILER PRIORITY = 40;
FILE PARAMS(KIND = DISK);
FAMILY DISK = ACCT OTHERWISE SYSPK;

Uses the COMPILER keyword to specify which file and task equations apply to the
compilation itself, and which apply to the resulting object code file.

Thus, the compiler runs with a PRIORITY setting of 40, and reads the input files specified
by the FILE CARD and FILE SOURCE equations.

8807 7391-006 10–7


Compiling Programs

The object code file created by the compilation stores the equation for the file PARAMS
and the equation for the task attribute FAMILY. The system applies these equations each
time that object code file is run, unless they are overridden by conflicting equations in the
RUN statement that initiates the program.

Modifying Code File Equations Later


MODIFY OBJECT/DBUPDATE;
FILE PARAMS(KIND = DISK, TITLE = DBPARAMS ON DBPACK);
FAMILY DISK = ACCT OTHERWISE SYSPK;
PRIORITY = 40;

Adds a file equation and two task equations to the object code file OBJECT/UPDATE.
These equations provide default values that are used each time the program is run. The
MODIFY statement itself does not actually compile or run the program.

If the object code file already has file or task equations, the equations supplied by the
MODIFY statement are merged with the existing equations. Where conflicts occur, the
equations supplied by MODIFY take precedence over the previous equations.

If the RUN statement supplies conflicting equations, the equations in the RUN statement
take precedence over the equations in the object code file.

Checking Whether the Compilation Was Successful


TASK CT;

COMPILE OBJECT/DBUPDATE WITH COBOL85 [CT] LIBRARY;


COMPILER FILE CARD(KIND = DISK, TITLE = DBUPDATE);

IF CT IS COMPILEDOK THEN
COPY OBJECT/DBUPDATE FROM DEVPK(PACK) TO USERPK(PACK)
ELSE ABORT "COMPILATION FAILED";

Compiles a program and checks whether the compilation succeeded.

CT

A task variable. Note the position of this task variable in the COMPILE statement: the task
variable is placed immediately after the compiler name (COBOL85).

CT IS COMPILEDOK

A Boolean expression that returns the value TRUE if the compile was successful.

10–8 8807 7391-006


Section 11
Managing Work Flow

Work flow management consists of controlling the order, timing, and priorities of the
various jobs that run on the system. The goal of work flow management is to ensure that
the system runs efficiently and gives preference to the most urgent elements of the work
load.

Overall work flow management policies are discussed in the System Administration
Guide. This section introduces the following work flow management features that you can
use in a WFL job:
• Assigning job attributes
• Using job queues
• Selecting a start time
• Running a job on a regular basis

Assigning Job Attributes


Rationale

The concept of task attributes was introduced under Using Task Equations. That section
explained how to specify task attributes in a statement that runs a task. To achieve a
similar effect for the WFL job as a whole, you can include a job attribute list at the start of
the job.

The job attribute list can include assignments to any task attributes. Some of the most
useful are the USERCODE, FAMILY, and PRIORITY attributes, which were described in
Section 5.

Assignments in the job attribute list affect the job from the moment it starts running.
However, certain job attributes affect the job even before it starts running, when the job is
being compiled. These attributes are related to work flow management, and are
discussed later in this section.

Format
BEGIN JOB <job name> (<job parameters>);
<job attribute list>
<declarations>
<statements>
END JOB

8807 7391-006 11–1


Managing Work Flow

The job attribute list is positioned after the job name and parameters (if any), but before
any declarations and statements in the job.

Example
BEGIN JOB RUNTRAN (STRING MODE);
FAMILY DISK = SYSPK OTHERWISE DISK;
PRIORITY = 40;
MAXPROCTIME = 360;
CLASS = 2;
STRING MFIX := "MODE = ";
RUN OBJECT/TRAN (MFIX & MODE);
END JOB

Assigns four job attributes.

Using Job Queues


Job queues are like channels that WFL jobs must pass through after being compiled and
before being executed, as illustrated in the following diagram.

By default, the system comes with a single job queue, which is queue 0. However, your
system administrator generally defines a set of job queues that are appropriate to the
needs of your site. The system administrator uses the MQ (Make or Modify Queues)
system command to define job queues.

The system administrator typically defines job queues to group together WFL jobs that
need to run with a similar priority, or that have similar patterns of resource usage.

Job Queue Attributes


Each job queue has its own properties, which are called job queue attributes. These job
queue attributes impose various limits on all the jobs that run through that particular job
queue.

11–2 8807 7391-006


Managing Work Flow

Job Queue Attribute Corresponding Job Attribute Effect

ELAPSEDLIMIT ELAPSEDLIMIT Limits the elapsed time for


execution of a job or any of its
tasks.

FAMILY FAMILY Specifies the default family


substitution for a job and its
tasks. Refer to Equating the
Family Statement in
Section 5, Running Tasks.
IOTIME MAXIOTIME Limits the total I/O time used
by the tasks of the job.

LINES MAXLINES Limits the total lines printed


by the tasks of the job.
MIXLIMIT None Delays initiation of a job if the
currently active jobs and tasks
from this job queue exceed
the MIXLIMIT value

PRIORITY PRIORITY Specifies the urgency of the


job and its tasks. Raising the
priority might make a job run
faster, but might also slow
down other processes on the
system.

PROCESSTIME MAXPROCTIME Limits the total processor


time used by a job or any of its
tasks.
SAVEMEMORY-LIMIT SAVEMEMORY-LIMIT Limits the total save memory
used by a job or any of its
tasks.
TAPE RESOURCE Delays job initiation until the
requested number of tape
units become available.
TASKLIMIT TASKLIMIT Limits the number of tasks a
job can have.
TURNAROUND None Specifies the maximum delay
that should occur between
the initiation of successive
jobs. If TURNAROUND time is
exceeded, but MIXLIMIT is
not, the system selects jobs
from this queue before other
queues.

WAITLIMIT WAITLIMIT Limits the time a job or any of


its tasks can remain waiting
due to a WAIT statement.

8807 7391-006 11–3


Managing Work Flow

Limits and Defaults


MQ 7 MIXLIMIT = 1, DEFAULTS (PRIORITY = 60), LIMITS
(PROCESSTIME = 120)

Defines job queue number 7, using the following elements:

LIMITS

Limits the admission of WFL jobs to this job queue. For example, suppose the job attribute
list of a WFL job includes the assignment MAXPROCTIME = 300. That job would not be
accepted into this job queue, because the MAXPROCTIME value of the job exceeds the
PROCESSTIME limit for the queue.

DEFAULTS

Specifies default values for job attributes. These defaults can be overridden by statements
in the job attribute list of each job. For example, suppose the job attribute list of a WFL job
does not include any PRIORITY assignment. The job receives a PRIORITY value of 60
because the job queue default for PRIORITY is 60.

MIXLIMIT

One of several job queue attributes that are separate from the DEFAULTS and LIMITS
clauses. The other job queue attributes in this category are FAMILY, TASKLIMIT, and
TURNAROUND.

Of these queue attributes,


• MIXLIMIT and TURNAROUND do not correspond to any job attributes.
• FAMILY and TASKLIMIT each specify a single value that is both the default and limit
for the corresponding job attribute.

Example Job Queues


MQ 1 MIXLIMIT = 2, LIMITS(PRIORITY = 60, PROCESSTIME = 120)

MQ 2 MIXLIMIT = 3, LIMITS(PRIORITY = 50, PROCESSTIME = 600)

MQ 3 MIXLIMIT = 1, LIMITS(PRIORITY = 40)

These system commands define several job queues. Following are the purposes of these
job queues:

Job queue 1

For short jobs that require rapid turnaround. These jobs are permitted an above-average
PRIORITY of 60, but a MIXLIMIT of 2 restricts the number of such jobs that can run at
once. To prevent misuse of this high-priority job queue, a PROCESSTIME limit of 120
seconds is enforced. Anyone who puts a lengthy, processor-intensive job in this queue
will find that the job gets DSed before it completes.

11–4 8807 7391-006


Managing Work Flow

Job queue 2

For medium-length jobs of average urgency. Because the PRIORITY is only average (50),
slightly more jobs are permitted from this queue (MIXLIMIT = 3). A PROCESSTIME limit
of 600 seconds (10 minutes) prevents this queue from being used for truly long jobs.

Job queue 3

For very long jobs that are not especially urgent. These are jobs that might take hours to
run. To enable other work to get done on the system, the PRIORITY is limited to the
below-average value of 40.

A MIXLIMIT of 1 is used to keep multiple jobs of this class from competing with each
other.

Following are the examples of WFL jobs that use this job queue structure.

Requesting an Appropriate Queue


BEGIN JOB RUNTRAN (STRING MODE);
CLASS = 2;
STRING MFIX := "MODE = ";
RUN OBJECT/TRAN (MFIX & MODE);
END JOB

Specifies that the job should run from job queue 2.

Requesting an Inappropriate Queue


BEGIN JOB RUNTRAN (STRING MODE);
CLASS = 2;
PRIORITY = 55;
STRING MFIX := "MODE = ";
RUN OBJECT/TRAN (MFIX & MODE);
END JOB

Specifies that the job should run from job queue 2, and also requests a priority of 55. This
priority is invalid because job queue 2 was defined with a priority limit of 50. Therefore,
the system refuses to place the job in the queue and displays a QDS message.

Allowing the System to Select a Job Queue


BEGIN JOB RUNCUSTOM;
PRIORITY = 55;
MAXPROCTIME = 50;
RUN OBJECT/DBUPDATE;
END JOB

Does not specify a job queue. The system therefore selects an appropriate queue for the
job. Following are some of the factors that can determine the choice:

8807 7391-006 11–5


Managing Work Flow

• The CLASS usercode attribute, which specifies a default job queue for jobs initiated
under a particular usercode.
• The system default queue, if any. This queue is defined by the DQ (Default Queue)
system command.
• Any resource-related attributes in the job attribute list. These include PRIORITY,
MAXCARDS, MAXIOTIME, MAXLINES, MAXPROCTIME, MAXWAIT, RESOURCE,
SAVEMEMORYLIMIT, TASKLIMIT, and WAITLIMIT. The system tries to find a job
queue whose queue attributes permit the values specified for the job attributes.

For a complete description of how the system selects the job queue, refer to the System
Administration Guide.

Selecting a Start Time


You can use the STARTTIME attribute to specify the date and time when a WFL job should
be initiated.

Start Time in the Job Attribute List


BEGIN JOB DAILY;
STARTTIME = 18:00;
RUN OBJECT/UPDATE;
END JOB

Causes the job wait in a job queue until at least 6:00 p.m. However, initiation is not
guaranteed to be exactly at 6:00. The job can be delayed by the queue MIXLIMIT.

Start Time in the START Statement


START DAILY/JOB; STARTTIME = 14:00;

Causes the job to wait in a job queue until at least 2:00 p.m.

The start time in the START statement overrides any start time specified in the job
attribute list.

Formats of the STARTTIME Value


STARTTIME = 18:00;
STARTTIME = 18:00 ON 09/14/2001;
STARTTIME = +4:00;
STARTTIME = 15:00 ON +4;

Examples showing the various formats that you can use to assign STARTTIME values.
Note the following rules:
• Times are specified using a 24-hour clock. Thus, 18:00 means 6:00 p.m.
• Dates are specified with the month first, then the day, then the year.
• A plus sign (+) means that the following time or date should be added to the current
time or date. For example, if the current time is 13:00, then +4:00 requests a time of
17:00.

11–6 8807 7391-006


Managing Work Flow

Running a Job on Regular Basis


You might have WFL jobs that need to run on a regular basis. For such jobs, you can
include a START statement that restarts the job at a later date or time.

Starting the Job Every Day


BEGIN JOB AUDIT/JOB;
RUN OBJECT/DBAUDIT ON SERV;
START AUDIT/JOB; STARTTIME = 07:00 ON + 1;
END JOB

Runs the program OBJECT/DBAUDIT on a daily basis. The job first runs the program. The
START statement then starts a new copy of the job with a STARTTIME of 7:00 a.m. on the
following day.

Starting the Job on Weekdays


BEGIN JOB AUDIT/JOB;
RUN OBJECT/DBAUDIT;
CASE TIMEDATE(DAY) OF
BEGIN
("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY"):
START AUDIT/JOB; STARTTIME = 07:00 ON + 1;
("FRIDAY"): START AUDIT/JOB; STARTTIME = 07:00 ON + 3;
("SATURDAY"): START AUDIT/JOB; STARTTIME = 07:00 ON + 2;
END;
END JOB

Runs the program each weekday (Monday through Friday), but not on weekends.

TIMEDATE(DAY)

Returns the name of the current day of the week.

+ 1, + 2, or + 3

Indicates the number of days to skip before the job is started.

8807 7391-006 11–7


Managing Work Flow

11–8 8807 7391-006


Section 12
Flow of Control

By default, the system executes all the statements in a WFL job one after another, in the
exact order that the statements appear. This section describes all the ways you can
change the order that statements are executed. In particular, this section describes the
following topics:
• BEGIN...END: Grouping statements together
• IF: Making a choice
• CASE: Choosing between many alternatives
• GO TO: Jumping to a statement elsewhere in the job
• WHILE and DO: Repeating statements in loops
• Subroutines: Reusing statements at various points in the job
• WAIT: Interrupting the job temporarily
• ABORT and STOP: Interrupting the job permanently

BEGIN...END: Grouping Statements Together


BEGIN
PRINT REP/OUTPUT ON DCON;
PRINT REP/REPORT ON DCON;
END;

Groups two or more statements together. These statements are then treated as a single
unit that can be used wherever a single statement is allowed. The BEGIN...END clause is
typically used within other flow-of-control statements, such as IF, CASE, DO, and WHILE.

IF: Making a Choice


Using IF statements, you can
• Make a choice, based on whether a particular Boolean value is TRUE or FALSE.
• Provide an alternative if the value is FALSE.
• Test several Boolean values by stringing IF statements together or nesting them.

8807 7391-006 12–1


Flow of Control

The Simple IF Statement


Logic Flow

Executes an action if a test condition is TRUE. Otherwise, skips past that action.

Example
RUN OBJECT/VALIDATE [T];
IF T(TASKVALUE = 1) THEN
BEGIN
PRINT VALID/DATA/=;
REMOVE TEMP/VALIDATE;
END;

Executes a PRINT statement and a REMOVE statement if the task OBJECT/VALIDATE set
its TASKVALUE task attribute to 1.

Rules

The IF statement executes another statement if a particular condition is true. You specify
the condition that should be checked, and the statement that should be executed if the
condition is true.

Test Condition

For descriptions of the various types of conditions that can be tested in an IF statement,
refer to Booleans: Evaluating Truth Conditions in Section 13, Working with Data.

12–2 8807 7391-006


Flow of Control

Providing an Alternative with IF ELSE


Logic Flow

Executes one of two actions, depending on whether the test condition is TRUE or FALSE.

Example
IF FILE TRANS/STATUS IS RESIDENT THEN
RUN OBJECT/TRANS;
ELSE
ABORT "NO FILE TRANS/STATUS";

Checks whether a file is resident, and takes one of two different actions, depending on the
result.

Stringing IF Statements
IF FILE TRANS/STATUS IS RESIDENT THEN
RUN OBJECT/TRANS;
ELSE
IF TRANS/BACKUP IS RESIDENT THEN
BEGIN
RUN OBJECT/TRANS;
FILE SOURCE = TRANS/BACKUP;
REMOVE TRANS/BACKUP;
END;
ELSE
ABORT "NO FILE TRANS/STATUS OR TRANS/BACKUP";

If the file TRANS/STATUS is resident, executes a RUN statement. Otherwise, checks to


see whether TRANS/BACKUP is resident, and either executes a RUN statement and a
REMOVE statement or aborts the job.

Nesting IF Statements
Incorrect Nesting
IF LENGTH(AXINPUT) GTR 0 THEN
IF TAKE(AXINPUT,1) = "R" THEN
RETRYVAL := TRUE;
ELSE
BADINPUT := TRUE;

8807 7391-006 12–3


Flow of Control

One IF statement occurs within another IF statement. At first glance, it might look as if
the ELSE clause goes with the outermost IF statement. However, for nested IF
statements, the WFL compiler matches the first ELSE clause it encounters with the
innermost IF statement. As a result, the BADINPUT assignment is executed only if the
length of AXINPUT is greater than 0 and the first character is not R.

Correct Nesting with BEGIN and END


IF LENGTH(AXINPUT) GTR 0 THEN
BEGIN
IF TAKE(AXINPUT,1) = "R" THEN
RETRYVAL := TRUE;
END
ELSE
BADINPUT := TRUE;

Uses a BEGIN . . . END clause to clearly separate the nested IF statement from the outer
IF statement. The BADINPUT assignment is executed any time AXINPUT has a length of
0.

Correct Nesting with a Null ELSE Clause


IF LENGTH(AXINPUT) GTR 0 THEN
IF TAKE(AXINPUT,1) = "R" THEN
RETRYVAL := TRUE;
ELSE
;
ELSE
BADINPUT := TRUE;

Uses a null ELSE clause to clearly separate the nested IF statement from the outer IF
statement. The BADINPUT assignment is executed any time AXINPUT has a length of 0.

CASE: Choosing Between Many Alternatives


Logic Flow

12–4 8807 7391-006


Flow of Control

Evaluates a case expression, and performs one of a specified list of actions.

Example
CASE STYPE OF
BEGIN
("DAILY"): RUN OBJECT/DAILY/UPDATE;
("WEEKLY"): RUN OBJECT/WEEKLY/UPDATE;
("SUMMARY"):
BEGIN
RUN OBJECT/REPORTSUM;
PRINT REPORTSUM/DATA;
END;
ELSE:
ABORT "INVALID INPUT STRING; USE DAILY, WEEKLY, OR SUMMARY";
END;

Runs several programs. For example, if STYPE has the value DAILY, this statement runs
the program OBJECT/DAILY/UPDATE.

STYPE

The case expression, which in this case is a string variable. Integer expressions are also
accepted.

BEGIN ... END

A clause that appears before and after the list of possible actions. (In some WFL
statements, the BEGIN...END clause is optional. The CASE statement is unusual in that it
requires the BEGIN...END clause.)

ELSE

Specifies an action to take if the string has none of the permitted values DAILY, WEEKLY,
or SUMMARY. If you do not include an ELSE clause, and the case expression does not
have one of the permitted values, the system discontinues the job with the error
BAD VALUE FOR CASE EXPRESSION

Case Expression

For descriptions of the various types of expressions that can be tested in a CASE
statement, refer to Numeric Values: Doing Your Arithmetic and Strings: Storing and
Modifying Text in Section 13, Working with Data.

8807 7391-006 12–5


Flow of Control

GO TO: Jumping to a Statement Elsewhere in the Job


Logic Flow

Skips forward or backward in the job to a statement with a specified label.

Example
RUN OBJECT/REPORT/PREP [T];
IF T ISNT COMPLETEDOK THEN
GO TO LASTTASK;
RUN OBJECT/REPORT/VALIDATE;
LASTTASK:
RUN OBJECT/REPORT/PRINT;

Skips the second of three tasks if the first task does not complete normally.

Programming Style and GO TOs

The use of GO TO statements is generally a sign of bad programming style. In general, the
more GO TO statements you use, the more difficult the job will be to understand or
maintain. Whenever you are tempted to use a GO TO statement, consider whether it
would be clearer to use another flow-of-control structure instead. For instance, the
preceding example could be expressed more clearly as
RUN OBJECT/REPORT/PREP [T];
IF T IS COMPLETEDOK THEN
RUN OBJECT/REPORT/VALIDATE;
RUN OBJECT/REPORT/PRINT;

WHILE and DO: Repeating Statements in loops


If you want to repeat an action several times in a row, then you can use one of the loop
statements: WHILE or DO.

12–6 8807 7391-006


Flow of Control

Repeating an Action While a Condition Is Met: WHILE Statement


Logic Flow

If the test condition is TRUE, executes an action repeatedly until the test condition is
FALSE. If the test condition is FALSE at the start, the action is never executed.

Example
WHILE LENGTH(INSTR) GEQ 4 DO
BEGIN
IF TAKE(INSTR,4) = "ACCT" THEN
BEGIN
INSTR := DROP(INSTR,4);
FRONT := FRONT & "ARCH";
END
ELSE
BEGIN
FRONT := FRONT & TAKE(INSTR,1);
INSTR := DROP(INSTR,1);
END;
END;

Searches through the string INSTR and replaces any occurrences of ACCT with ARCH.

The WHILE statement tests the length of INSTR at the start, because there is no point in
checking any further if INSTR is not long enough to contain the phrase ACCT.

Test Condition

For descriptions of the various types of conditions that can be tested in a WHILE
statement, refer to Booleans: Evaluating Truth Conditions in Section 13, Working with
Data.

8807 7391-006 12–7


Flow of Control

Repeating an Action Until a Condition Is Met: DO Statement


Logic Flow

Executes an action repeatedly until the test condition is TRUE. If the test condition is
FALSE at the start, the action is still executed once.

Example
DO
BEGIN
INITIALIZE(T);
RUN OBJECT/VALIDATE [T];
END
UNTIL T(TASKVALUE) GTR 0;

Runs the program OBJECT/VALIDATE until it returns a TASKVALUE greater than 0.

The INITIALIZE statement is included because the task variable T is being reused. Refer to
Reusing Task Variables in Section 5, Running Tasks.

Test Condition

For descriptions of the various types of conditions that can be tested in a DO statement,
refer to Booleans: Evaluating Truth Conditions in Section 13, Working with Data.

Repeating an Action a Fixed Number of Times


I := 0;
DO
BEGIN
INITIALIZE(T);
RUN OBJECT/VALIDATE [T];
I := I + 1;
END
UNTIL I GEQ 4;

Runs a program exactly four times. The integer variable I is used to keep track of how
many times the program has been run.

This use of the DO statement with an integer variable is the closest WFL equivalent to the
FOR statement provided by some other languages.

12–8 8807 7391-006


Flow of Control

Subroutines: Reusing Statements at Various Points


in the Job
Logic Flow

Each time a subroutine is invoked, all the statements in the subroutine are executed. Then
execution continues with the statement following the subroutine invocation statement.
The subroutine can be invoked from many different places within the WFL job.

Example
110 BEGIN JOB;
120
130 SUBROUTINE CLEANUP;
140 BEGIN
150 RUN OBJECT/UTIL/TRACK;
160 SECURITY TRACK/OUTPUT PUBLIC IO;
170 COPY TRACK/OUTPUT TO DEVPK(PACK);
180 END;
190
200 RUN OBJECT/VALIDATE;
210 CLEANUP;
220 RUN OBJECT/FORMAT;
230 CLEANUP;
240 RUN OBJECT/REPORT;
250 CLEANUP;
260
270 END JOB

Runs three programs. After running each program, executes the subroutine CLEANUP.

SUBROUTINE CLEANUP

Begins the declaration of the subroutine. Note that a WFL job consists of a series of
declarations, followed by a series of statements. Thus, the subroutine declaration is earlier
in the job than the statements that invoke the subroutine.

8807 7391-006 12–9


Flow of Control

CLEANUP

Causes the subroutine to be executed.

The statements in this job are executed in the following order:


1. 200 through 210
2. 130 through 180
3. 220 through 230
4. 130 through 180
5. 240 through 250
6. 130 through 180

Using Parameters
Rationale

You can use parameters to pass data to a subroutine. The behavior of the subroutine can
be made to vary, depending on the parameters that you pass to it.

Example
BEGIN JOB CUSTOM (STRING INPARAM);

STRING INBUF;
SUBROUTINE REMOVEBLANKS(STRING INSTR);
BEGIN
BOOLEAN DONE;
STRING LEADCHAR,
NEWSTR;
DONE := FALSE;
WHILE NOT DONE DO
BEGIN
LEADCHAR := TAKE(INSTR,1);
IF LEADCHAR NEQ " " THEN
NEWSTR := NEWSTR & LEADCHAR;
IF LENGTH(INSTR) GTR 1 THEN
INSTR := DROP(INSTR,1);
ELSE
DONE := TRUE;
END;
INSTR := NEWSTR;
END REMOVEBLANKS;

INBUF := INPARAM;
REMOVEBLANKS (INBUF);
DISPLAY (INBUF);
RUN OBJECT/REFDATA (INBUF);
END JOB

12–10 8807 7391-006


Flow of Control

Uses the subroutine REMOVEBLANKS to delete any blank characters from a string
parameter provided by the operator.

STRING INSTR

The parameter as declared in the subroutine. This is known as the formal parameter.

INSTR := NEWSTR;

Changes the value of the parameter that was passed to the subroutine.

INBUF

The parameter that is passed in the subroutine invocation statement. This parameter is
known as the actual parameter. The subroutine changes this value by removing all blanks
from it.

Exiting Early
SUBROUTINE REPORTER;
BEGIN
TASK T;
RUN OBJECT/PAYROLL/REPORT [T];
IF (T IS COMPLETEDOK) AND
(FILE PAYROLL/NEWMASTER IS RESIDENT) THEN
RETURN;
RUN OBJECT/PAYROLL/RECOVER;
END REPORTER;

Runs the task OBJECT/PAYROLL/REPORT and takes the following actions:

If the task completes . . . Then . . .

Successfully The RETURN statement causes an early exit


from subroutine REPORTER. Job execution
jumps from the RETURN statement to the
statement following the subroutine invocation.

Unsuccessfully The subroutine runs the second task,


OBJECT/PAYROLL/RECOVER.

Additional Features
WFL subroutines have several capabilities that will be noted here only briefly. For further
information about any of the following features, refer to the WFL Programming Reference
Manual:

8807 7391-006 12–11


Flow of Control

• Subroutine parameters can be of type Boolean, integer, real, string, file, or task.
• By default, subroutine parameters are passed by reference. In other words, if the
subroutine changes the value of a parameter, that change is visible to the rest of the
job. To make such changes visible only within the subroutine, add the word VALUE to
the formal parameter declaration.
• You can use the PROCESS <subroutine> statement to initiate a subroutine as an
asynchronous task. This is a task that runs in parallel with the job.

WAIT: Interrupting the Job Temporarily


Logic Flow

Stops execution of the job until a particular condition is fulfilled.

Waiting for a File


WAIT (FILE TEMP/INDEX/HTML ON SERV IS RESIDENT);

Waits until the file TEMP/INDEX/HTML is present on SERV family.

Waiting for an Operator OK


WAIT (OK);

Waits for the operator to enter a <mix number> OK command.

Waiting for a Length of Time


WAIT (120);

Waits for 120 seconds (that is, two minutes).

Waiting for Tasks


The WAIT statement has several features that allow the job to wait for parallel tasks. Refer
to the following topics in Section 5, Running Tasks:
• Waiting for Tasks to Terminate

12–12 8807 7391-006


Flow of Control

• Waiting for Changes in Task Status


• Waiting for a Task Attribute Value

ABORT and STOP: Interrupting the Job Permanently


Logic Flow

Ends execution of the job. Any remaining statements in the job are never executed.

Example
RUN OBJECT/PREPARE [T1];
IF T1 IS NOT COMPLETEDOK THEN
ABORT "Job aborted due to failure of OBJECT/PREPARE";
RUN OBJECT/SORTDATA [T2];
IF T2 IS NOT COMPLETEDOK THEN
STOP "Job terminated due to failure of OBJECT/SORTDATA";
RUN OBJECT/REPORT;

The ABORT and STOP statements differ only in the termination messages they produce.
• An ABORT statement causes the system to display a PDS termination message,
which is typical of an abnormal termination.
• A STOP statement causes the system to display an EOJ termination message, which
is typical of a normal termination.

8807 7391-006 12–13


Flow of Control

12–14 8807 7391-006


Section 13
Working with Data

Because WFL is specialized for job control, WFL does not contain such elaborate data
manipulation and I/O capabilities as many programming languages. For example, WFL can
neither read from nor write to files.

However, WFL does support several types of data that you can use to control tasks. This
section explains the following topics:
• Variables: Using placeholders for data
• Job parameters: Making your job flexible
• Booleans: Evaluating truth conditions
• Numeric values: Doing your arithmetic
• Strings: Storing and modifying text

This section is not required reading for the beginner. Refer to this section if you are
specifying a value in some WFL statement, and you find yourself unsure of how to create
or specify that value.

Variables: Using Placeholders for Data


A variable is a type of placeholder that stores a particular type of data. Statements can read
the values of variables, or assign new values to the variables.

All variables must be declared at the start of the job, before the statements begin. A
declaration simply defines the variable so it can be used.

Example
BEGIN JOB;
BOOLEAN B1,
B2 := TRUE;
INTEGER INT1 := 16,
INT2 := 23;
REAL R1 := 3.6,
R2;
STRING STR := "STANDARD";

IF B2 THEN
RUN (ICS)OBJECT/DBREPORT (INT1, R1, STR);

8807 7391-006 13–1


Working with Data

END JOB

Declares several variables and uses several of them in an IF statement.

Data Types

There are four types of simple variables:


• Boolean
Stores a TRUE or FALSE value. The default value is FALSE.
• Integer
Stores a positive or negative number with no fractional part. The default value is 0.
• Real
Stores a positive or negative number, possibly with a fractional part. The default value
is 0.
• String
Stores a series of letters, numbers, and/or special characters. Strings vary in length
and can be up to 1,024 characters long. The default value is a null string ″″, which
contains 0 characters.

Multiple Declarations
INTEGER INT1,
INT2;

A single declaration can declare multiple variables, which must be separated by commas.

Establishing the Initial Values


INTEGER INT1 := 14,
INT2 := -4;

You can specify initial values different from the defaults in the declaration.

Assigning Values
INTEGER INT1, INT2;
.
.
.
INT1 := INT2 * 3;

You can use assignment statements to change the value of a variable at any point in the
job. The assignment operator (:=) assigns the value on the right to the variable on the left.
For example, if INT2 has the value 4, then the preceding statement multiplies 4 by 3 to get
12, and assigns the result to the variable INT1.

13–2 8807 7391-006


Working with Data

Other Types of Declarations

This section does not discuss the following types of declarations:


• TASK declarations
Create task variables, which enable you to read or assign task attributes. Refer to
Using Task Variables in Section 5, Running Tasks.
• FILE declarations
Create file variables, which you can use to read the attributes of a file. Refer to
Reading File Attributes in Section 6, Managing Files.
• Subroutine declarations
Store groups of statements for convenient reuse. Refer to Subroutines: Reusing
Statements at Various Points in the Job in Section 12, Flow of Control.

Job Parameters: Making Your Job Flexible


BEGIN JOB DBUPDATE (STRING DIR NOLIST,
BOOLEAN CASED OPTIONAL,
INTEGER ATTEMPTS OPTIONAL DEFAULT = 1,
REAL TVAL OPTIONAL);
JOBSUMMARY = SUPPRESSED;

RUN OBJECT/DBUPDATE (DIR, CASED);


RESTART = ATTEMPTS;
TASKVALUE = TVAL;

END JOB

Accepts several job parameters that the operator can specify in the START statement. The
job then uses the parameter values to specify various parts of a RUN statement. Because
the parameter values are specified by the operator at run-time, they make it possible for a
single job to have many different effects.

NOLIST

Indicates that the value of the parameter is to be suppressed from the job summary, the
SQ (Show Queue) response, the analysis of the beginning-of-job log record in the job
summary, and by LOGANALYZER.

OPTIONAL

Indicates a parameter that is not required in the START statement. If the parameter is
omitted, the job uses the default value for that data type (FALSE for Booleans, 0 for
integers or reals, ″″ for strings).

DEFAULT = <value>

8807 7391-006 13–3


Working with Data

Supplies an initial value for an optional parameter. This value is used only if the START
statement omits the parameter. You can use the DEFAULT clause if you want the default
to be different from the default for that data type. The example provides a default of 1 for
an integer parameter, which would otherwise default to 0.

Supplying All Parameters


START DBUPDATE ("(ACCT)INCOMING", TRUE, 2, 5.3);

Initiates the previous example and provides values for each of the parameters.

Omitting Optional Parameters


START DBUPDATE ("(ACCT)INCOMING");

Supplies only the required parameter DIR.

Supplying Some Parameters


START DBUPDATE ("(ACCT)INCOMING",,, 5.3);

START DBUPDATE ("(ACCT)INCOMING", TVAL := 5.3);

Supply the first and last parameters only. These examples show two different ways of
omitting selected optional parameters:
• Specifying only a comma for each omitted parameter
• Skipping parameters and specifying the next parameter by name, such as TVAL

Booleans: Evaluating Truth Conditions


The following pages describe the types of expressions that evaluate to simply TRUE or
FALSE. These expressions are particularly useful in flow-of-control statements such as IF,
WHILE, and DO. For information about flow-of-control statements, refer to
Section 12, Flow of Control.

For instructions on using Boolean expressions to check whether a file is present, refer to
Determining if a File Is Resident in Section 6, Managing Files.

The following pages cover these topics:


• Checking the state of a task
• Checking task and file attributes
• Comparing values
• Creating complex Boolean expressions

13–4 8807 7391-006


Working with Data

Checking the State of a Task


<task variable> IS <task state>
<task variable> ISNT <task state>

Two forms of the task state expression, which returns information about the current state
of a task. Possible values of the task state are as follows:

Task State Meaning

SCHEDULED The task has not yet been initiated by the system.
ACTIVE The task is currently running.

STOPPED The task was stopped by the operator, suspended by the system, or
programmatically suspended.
INUSE The task is SCHEDULED, ACTIVE, or STOPPED.
COMPLETED The task was initiated and has terminated.

COMPLETEDOK The task is completed and was terminated without faulting or being
discontinued.

COMPILEDOK The task compiled without syntax errors.


ABORTED The task faulted or was discontinued.

For examples that use the task state expression, refer to Checking Whether a Task
Completed Successfully and Waiting for Changes in Task Status in Section 5, Running
Tasks.

Checking Task Attribute Values


The syntax for checking task attribute values varies, depending on the type of data stored
in the task attribute. To determine the data type of a particular task attribute, refer to the
Task Attributes Programming Reference Manual.

Boolean Task Attributes


IF T(SW1) THEN ...

Numeric Task Attributes


IF T(TASKVALUE) = 0 THEN ...

Mnemonic Task Attributes


IF T(HISTORYCAUSE) IS OPERATORCAUSEV THEN ...

String Task Attributes


IF T(TASKSTRING) = "MISSING DATA" THEN ...

8807 7391-006 13–5


Working with Data

Checking File Attribute Values


The syntax for checking file attribute values varies, depending on the type of data stored in
the file attribute. To determine the data type of a particular file attribute, refer to the File
Attributes Programming Reference Manual.

Preliminaries
FILE G(KIND=DISK,NEWFILE=FALSE,DEPENDENTSPECS=TRUE,
TITLE=TEMP/UTIL ON DCON);
OPEN(G);

You must declare and open the file before checking any file attribute values.

Numeric File Attributes


IF G(CREATIONDATE) LSS 97001 THEN ...

Mnemonic File Attributes


IF G(SECURITYTYPE) IS PRIVATE THEN ...

Comparing Values
You can compare strings with strings, numeric values with numeric values, or Boolean
values with Boolean values. You can also build complex combinations of comparisons.

The following table shows the keywords you can use to compare or modify values in a
Boolean expression:

Types of Values Keyword Meaning

Boolean AND TRUE if both Boolean values


are TRUE

EQV TRUE if both Boolean values


are TRUE or both Boolean
values are FALSE
IMP TRUE unless the first Boolean
value is TRUE and the second
Boolean value is FALSE
NOT Returns the opposite of the
Boolean value it precedes
OR TRUE if either or both Boolean
values are TRUE

13–6 8807 7391-006


Working with Data

Types of Values Keyword Meaning

Numeric GTR, > Greater than


GEQ Greater than or equal to

EQL, = Equal to

NEQ Not equal to


LEQ Less than or equal to

LSS, < Less than


String EQL, = Equal to

NEQ Not equal to

Boolean Comparison
IF BOOL1 AND NOT BOOL2 THEN ...

Numeric Comparison
IF I LSS 43 THEN ...

String Comparison
IF STR1 = "CLEANUP" THEN ...

Creating Complex Boolean Expressions


IF ((FILE REMINDERS/INPUT IS RESIDENT) OR
(TIMEDATE(DAY) = "FRIDAY")) AND
(MYJOB(USERCODE = "JHIGGS")) THEN ...

Uses sets of parentheses to indicate the order in which the complex expression should be
evaluated. The innermost expressions are evaluated first.

Suppose that the file REMINDERS/INPUT is resident, the date is not Friday, and the job
usercode is JHIGGS. In this case, the expression evaluates as
(TRUE OR FALSE) AND TRUE

Then as
TRUE AND TRUE

Then as
TRUE

8807 7391-006 13–7


Working with Data

Numeric Values: Doing Your Arithmetic


The following pages describe the types of expressions that evaluate to numeric values.
These expressions are particularly useful when you want to assign values to numeric task
or file attributes, or pass a numeric parameter to a task.

Integers and Reals


REAL RVAL := 14.688;
INTEGER IVAL;
IVAL := RVAL; % IVAL set to 14
RVAL := IVAL + 0.43; % RVAL set to 14.43

You can generally use real expressions and integer expressions interchangeably in WFL.
For example, you can assign an integer value to a real variable, or a real value to an integer
variable.

Notes:
• The fractional part of a real value is truncated when you assign that value to an integer.
Truncation always reduces the real value to the integer with the next lowest absolute
value. For example, 5.76 truncates to 5, and -5.76 truncates to -5.
• Real variables can store much greater values than integer variables can. If you assign a
real variable to an integer variable and the real variable has a value higher than
549755813887, then the fatal error INTEGER OVERFLOW occurs.

Numeric Operators
Following are the operators you can use to modify numeric values.

Operator Effect

+ Addition. Example: 2 + 2 yields a value of 4.

– Subtraction. Example: 4 – 2 yields a value of 2.


Negation. Example: –4 + 2 yields a value of –2.

* Multiplication. Example: 2 * 2 yields a value of 4.


/ Real division. Example: 5 / 2 yields a value of 2.5.

DIV Integer division. Example: 5 DIV 2 yields a value of 2.


MOD Remainder from integer division. Example: 5 MOD 2 yields a
value of 1.

13–8 8807 7391-006


Working with Data

Complex Numeric Expressions


RVAL1 := 2;
RVAL2 := 3;
RVAL3 := 8;
RVAL4 := RVAL1 + RVAL2 / RVAL3 - 16; % Yields -13.625
RVAL4 := (RVAL1 + RVAL2) / (RVAL3 - 6); % Yields 2.5

Performs a complex computation. RVAL1, RVAL2, RVAL3, and RVAL4 are all real variables.
The expression yields drastically different results, depending on whether you use
parentheses.

The first assignment to RVAL4 has no parentheses. The system therefore evaluates the
expression using a default order of evaluation. In this order, multiplication and division are
always performed before addition or subtraction. The expression is thus treated as 2 +
0.375 – 16, or 2.375 – 16, or –13.625.

It is better to always use parentheses in a complex expression. The parentheses make


your intended order of evaluation perfectly clear. The portions in parentheses are
performed first. Thus, in the second assignment to RVAL4, the expression is treated as 5 /
2, or 2.5.

Strings: Storing and Modifying Text


You can use string functions to split strings into pieces, or to combine smaller strings into
larger strings. You can use the strings that you create for such purposes as:
• Specifying parameters in a RUN statement or a subroutine invocation
• Specifying file names in statements that affect files, such as COPY, CHANGE, and
REMOVE
• Specifying values for string-valued task attributes and file attributes

Combining Strings
STR1 := "REPORT";
STR2 := "SUM";
STR3 := STR1 & STR2;

Assigns STR3 the value REPORTSUM using the ampersand (&) operator, which attaches
one string to the end of another string.

Building File Titles


Rationale

Many WFL statements need to specify file titles, including common statements such as
RUN, COPY, CHANGE, and REMOVE.

8807 7391-006 13–9


Working with Data

For each of these statements, you can use constants and/or string expressions to specify
the file titles. Constants are useful for file titles that will be the same each time the job is
run. String expressions make it possible for a statement to affect different files each time
the job is run.

Using Constants
RUN OBJECT/DBUPDATE;
FILE SOURCE = (DBCON)CUST/DATA;

COPY (OPS)DAILY/REPORT TO DAILY(TAPE);

Two statements that use constants to specify filenames.

Using Strings
BEGIN JOB DBUPDATE (STRING FNAME);
JOBSUMMARY = SUPPRESSED;

RUN OBJECT/DBUPDATE;
FILE OPTIONS = TRANS/OPT ON DEVPK;
FILE SOURCE = #FNAME;

COPY LOG/#FNAME/OUT TO DBBACK(TAPE);

END JOB

Uses a string-valued job parameter to supply a file name and part of another file name. For
example, if the parameter has the value ″SEPT/REPORTS″, then file SOURCE is equated
to ″SEPT/REPORTS″.

Note that the string variable name must be preceded by a number sign (#). If the number
sign in this example were omitted, the title of the file SOURCE would be changed to
″FNAME″.

The COPY statement uses a combination of a string value and constants to specify a
filename such as ″LOG/SEPT/REPORTS/OUT″. You can use string expressions in this way
to replace any portion of a file title.

Building Strings with File Title Operators


STR1 := "CONFIG";
STR2 := "LOGS";
STR3 := "DEVPK";
STR4 := * STR1 / STR2 /= ON STR3;
RUN OBJECT/DBUPDATE;
FILE SOURCE = #STR4;

Uses several string operators to build a string that contains the value ″*CONFIG/LOGS/=
ON DEVPK″. These operators are particularly suited to building file titles:
• *
Prefixes a string with an asterisk, which signifies the null usercode.
• /

13–10 8807 7391-006


Working with Data

Combines two strings and places a slash between them.


• /=
Adds the /= characters after a string.
• ON
Combines two strings and places ″ ON ″ between them. Note the presence of a space
before and after the word ON.

Modifying a String
WFL provides the following functions for selecting parts of a string:

Form Purpose

LENGTH (<string>) Returns the number of characters in the string

HEAD ( <string>, <character set>) Returns all leading characters in the string that
belong to the character set
TAIL ( <string>, <character set> ) Returns the part of the string that would not be
returned by a HEAD function with the same
parameters
TAKE ( <string>, <number> ) Returns the specified number of characters
from the start of the string

DROP ( <string>, <number> ) Returns the part of the string that would not be
returned by a TAKE function with the same
parameters
UPPERCASE (<string expression>) Converts the string expression to uppercase
characters.
LOWERCASE (<string expression>) Converts the string expression to lowercase
characters.

You can use various combinations of these functions to select any portion of a string that
you want. However, the actual use of these functions can quickly become complicated.

The following pages demonstrate how to combine these features to accomplish the
following tasks:
• Removing blanks
• Removing leading and trailing blanks
• Replacing a target within the string
• Parsing a file title
• Parsing a family task attribute
• Converting a string to uppercase or lowercase characters
• Converting between strings and numbers

8807 7391-006 13–11


Working with Data

Removing Blanks
SUBROUTINE REMOVEBLANKS(STRING INPUTSTR);
BEGIN
STRING FRONT, % All nonblank chars get copied into this string
MID; % Buffer for storing single characters
WHILE LENGTH(INPUTSTR) GTR 0 DO
BEGIN
MID := TAKE(INPUTSTR,1);
IF MID NEQ " " THEN
FRONT := FRONT & MID;
INPUTSTR := DROP(INPUTSTR,1);
END;
INPUTSTR := FRONT;
END REMOVEBLANKS;

Removes all blank characters from a string.

Example Call and Result


TESTSTR := "The Quick Brown Fox";
REMOVEBLANKS(TESTSTR);

After REMOVEBLANKS runs, TESTSTR has the value ″TheQuickBrownFox″.

Explanation

This subroutine works by repeatedly performing the following operations:


1. Copying the first character of INPUTSTR into the string MID
2. Adding MID to the end of the string FRONT if MID is not a blank character
3. Deleting the first character of INPUTSTR

As the subroutine progresses, the string FRONT gets longer and the string INPUTSTR
gets shorter. When INPUTSTR is empty, the contents of FRONT are copied back into
INPUTSTR.

Removing Leading and Trailing Blanks


SUBROUTINE REMOVELEAD (STRING INSTR);
BEGIN
BOOLEAN DONE := FALSE;
WHILE NOT DONE DO
BEGIN
IF LENGTH(INSTR) GTR 0 THEN
IF TAKE(INSTR,1) = " " THEN
INSTR := DROP(INSTR,1)
ELSE DONE := TRUE % Done if nonblank char
ELSE DONE := TRUE; % Done if no chars left
END;
END;

SUBROUTINE REMOVETRAIL (STRING INSTR);


BEGIN

13–12 8807 7391-006


Working with Data

BOOLEAN DONE := FALSE;


WHILE NOT DONE DO
BEGIN
IF LENGTH(INSTR) GTR 0 THEN
% If last char is blank...
IF DROP(INSTR,LENGTH(INSTR) - 1) = " " THEN
% Then drop last char
INSTR := TAKE(INSTR,LENGTH(INSTR) - 1)
ELSE DONE := TRUE % Done if nonblank char
ELSE DONE := TRUE; % Done if no chars left
END;
END;

Removes all leading or trailing blank characters from a string.

Example Call and Result


TESTSTR := " (ACCT) TEST / DATA ";
REMOVELEAD(TESTSTR);
REMOVETRAIL(TESTSTR);

After REMOVELEAD and REMOVETRAIL have run, TESTSTR has the value
"(ACCT) TEST / DATA"

Replacing a Target within the String


SUBROUTINE REPLACETARGET (STRING INSTR, % String to search through
STRING TARGET, % Substring to search for
STRING REPLACEMENT, % Replacement substring
BOOLEAN CASED); % Case-sensitivity
BEGIN
INTEGER TLEN; % Length of target
STRING COMP, % First TLEN chars of INSTR
FRONT, % Chars that have already been searched through
TARGETBUF; % Uppercased version of target
TARGETBUF := TARGET;
% Uppercase target if case-insensitive search
IF NOT CASED THEN
TARGETBUFF := UPPERCASE (TARGETBUF);
TLEN := LENGTH(TARGETBUF);
WHILE LENGTH(INSTR) GEQ TLEN DO
BEGIN
% Store TLEN chars of INSTR
COMP := TAKE(INSTR,TLEN);
% Uppercase COMP if case-insensitive search
IF NOT CASED THEN
COMP := UPPERCASE (COMP);
% If target matches COMP, then replace with new text
IF COMP = TARGETBUF THEN
BEGIN
INSTR := DROP(INSTR,TLEN);
FRONT := FRONT & REPLACEMENT;
END
% If target doesn't match COMP, then
% advance to next char in INSTR

8807 7391-006 13–13


Working with Data

ELSE
BEGIN
FRONT := FRONT & TAKE(INSTR,1);
INSTR := DROP(INSTR,1);
END;
END;
% Update INSTR to reflect replacements
INSTR := FRONT & INSTR;
END;

Searches a string for occurrences of a text target, and replaces any such occurrences with
specific replacement text.

Example Call and Result


TESTSTR := "The Quick Brown Dogs";
REPLACETARGET(TESTSTR, "dog", "Kitten", FALSE);

After REMOVEBLANKS runs, TESTSTR has the value ″The Quick Brown Kittens″. The
target ″dog″ matches the text ″Dog″ because the search is not case-sensitive.

Example Call and Result


TESTSTR := "The Quick Brown Dogs";
REPLACETARGET(TESTSTR, "dog", "kitten", TRUE);

After REMOVEBLANKS runs, TESTSTR has the value ″The Quick Brown Dogs″. The target
″dog″ does not match the text ″Dog″ because the search is casesensitive.

Explanation
• INSTR
The larger string that is to be searched for the target text.
• TARGET
The target text that is searched for.
• REPLACEMENT
The text to replace the target text with.
• CASED
The mode of comparison to use: case-sensitive or case-insensitive.

Parsing a File Title


File titles are one of the most common types of strings to use in a job. In some cases you
might want to analyze a file title supplied by a job parameter or other source. For example,
you might want to change a portion of the file title, or use part of it is as a building block
when creating a title for a different file.

The following pages show how to extract the usercode, file name, or family name from a
file title.

13–14 8807 7391-006


Working with Data

Assumptions

For these subroutines to work correctly, the file title that is passed to them must follow
valid file title syntax.

Extracting the Usercode


SUBROUTINE FINDUSER (STRING TITLE, % Inputs the title
STRING UC); % Returns the usercode
BEGIN
BOOLEAN DONE;
STRING FRONT,
BACK,
TITLEBUF; % Stores copy of title
DONE := FALSE;
TITLEBUF := TITLE;
TITLEBUF := UPPERCASE (TITLEBUF); % Uppercase the title
IF LENGTH(TITLEBUF) = 0 THEN % Check for empty title
BEGIN
UC := "";
RETURN;
END;
REMOVELEAD (TITLEBUF); % Remove leading blanks
CASE TAKE(TITLEBUF,1) OF % Check leading char
BEGIN
("*"): UC := "*"; % Nonusercoded file
("("): % File has usercode
BEGIN
TITLEBUF := DROP(TITLEBUF,1);
UC := HEAD(TITLEBUF, NOT ")");
IF UC = TITLEBUF THEN % Means there was no ")"
UC := ""; % Could not find a valid usercode
END;
ELSE: UC := ""; % Usercode not explicitly specified
END;
END;

Extracts the usercode from a file title.

Example Call and Result


TITLESTR := "(ACCT)CUST/DATA ON DEVPK";
FINDUSER(TITLESTR, USERSTR);

After FINDUSER runs, USERSTR has the value ″ACCT″.

Explanation

REMOVELEAD

Remove leading and trailing blanks from a string. Refer to “Removing Leading and Trailing
Blanks” earlier in this section.

8807 7391-006 13–15


Working with Data

Extracting the Family Name


SUBROUTINE FINDFAM (STRING TITLE, STRING FAM);
BEGIN
BOOLEAN DONE;
STRING BACK, FRONT, LASTCHAR, TEST, TITLEBUF;
INTEGER TLEN;
TITLEBUF := TITLE;
TITLEBUF := UPPERCASE (TITLEBUF);
REMOVELEAD (TITLEBUF); % Remove leading blanks
REMOVETRAIL (TITLEBUF); % Remove trailing blanks

DONE := FALSE;
TLEN := LENGTH(TITLEBUF);
WHILE NOT DONE DO % To extract last word,
BEGIN % scan backward for blanks
% Check length of remainder first; if a file title includes
% a family, the remainder must be at least 4 char
% E.g. "A ON B" minus the family name is "A ON"
IF TLEN GTR 4 THEN
BEGIN
LASTCHAR := DROP(TITLEBUF, TLEN - 1); % Look at last char
IF LASTCHAR NEQ " " THEN % Remove char from title and
BEGIN % add it to FAM string instead
FAM := LASTCHAR & FAM;
TITLEBUF := TAKE(TITLEBUF, TLEN - 1);
TLEN := TLEN - 1;
END
ELSE DONE := TRUE % We hit a blank, found start of family
END
ELSE % Remainder is 4 char or less; this title does not
BEGIN % include a family name
DONE := TRUE;
FAM := "";
END;
END;
REMOVETRAIL (TITLEBUF); % Remove trailing blanks again
% Check for ON statement
TLEN := LENGTH(TITLEBUF);
IF TLEN LSS 3 THEN % No room for ON statement
FAM := ""
ELSE IF DROP(TITLEBUF, TLEN - 3) NEQ " ON" THEN
FAM := "";
ELSE IF LENGTH(TAIL(FAM, ALPHA)) NEQ 0 THEN
FAM := ""; % There are illegal characters in family name
ELSE % Ensure there is a file name before ON
BEGIN
TITLEBUF := TAKE(TITLEBUF, TLEN - 3);
TEST := HEAD(TITLEBUF, NOT " ");
IF TEST = "" THEN
FAM := "";
END;
END;

Extracts the family name from a file title. If there is no family name, returns a null string as
the family name.

13–16 8807 7391-006


Working with Data

Example Call and Result


TITLESTR := "(ACCT)CUST/DATA ON DEVPK";
FINDFAM(TITLESTR, FAMSTR);

After FINDFAM runs, FAMSTR has the value ″DEVPK″.

Explanation

REMOVELEAD, REMOVETRAIL

Remove leading and trailing blanks from a string. Refer to “Removing Leading and Trailing
Blanks” earlier in this section.

Extracting the File Name


SUBROUTINE FINDNAME (STRING FTITLE, STRING FNAME);
BEGIN
STRING UC, FAM;
FNAME := FTITLE; % Copy title to buffer
FNAME := UPPERCASE(FNAME); % Uppercase title
REMOVELEAD(FNAME); % Delete leading blanks
REMOVETRAIL(FNAME); % Delete trailing blanks
IF LENGTH(FNAME) = 0 THEN % Check for empty string
RETURN;
% Prepare to delete family name
FINDFAM(FNAME, FAM); % Extract copy of family name
IF LENGTH(FAM) NEQ 0 THEN
BEGIN
% Delete family name
FNAME := TAKE(FNAME, LENGTH(FNAME) - LENGTH(FAM));
% Delete trailing blanks
REMOVETRAIL (FNAME);
% Delete " ON" phrase
FNAME := TAKE(FNAME, LENGTH(FNAME) - 3);
END;
% Delete trailing blanks again
REMOVETRAIL(FNAME);

TITLEBUF := TITLE;
TITLEBUF := UPPERCASE (TITLEBUF); % Uppercase the title
IF LENGTH(TITLEBUF) = 0 THEN % Check for empty title
BEGIN
UC := "";
RETURN;
END;
REMOVELEAD (TITLEBUF); % Remove leading blanks
CASE TAKE(TITLEBUF,1) OF % Check leading char
BEGIN
("*"): UC := "*"; % Nonusercoded file
("("): % File has usercode
BEGIN
TITLEBUF := DROP(TITLEBUF,1);
UC := HEAD(TITLEBUF, NOT ")");
IF UC = TITLEBUF THEN % Means there was no ")"

8807 7391-006 13–17


Working with Data

UC := ""; % Could not find a valid usercode


END;
ELSE: UC := ""; % Usercode not explicitly specified
END;
END;

Examines a file title and returns the middle part, which does not include the usercode or
family name.

Example Call and Result


TITLESTR := "(ACCT)CUST/DATA ON DEVPK";
FINDNAME(TITLESTR, FNAMESTR);

After FINDNAME runs, FNAMESTR has the value ″CUST/DATA″.

Explanation
• REMOVELEAD and REMOVETRAIL
Remove leading and trailing blanks from a string. Refer to “Removing Leading and
Trailing Blanks” earlier in this section.
• FINDUSER
Returns the usercode part of a file title. Refer to “Extracting the Usercode” earlier in
this section.
• FINDFAM
Returns the family part of a file title. Refer to “Extracting the Family Name” earlier in
this section.

Parsing a FAMILY task attribute


Of all the task attributes, the FAMILY task attribute has one of the most complicated
formats. The value can have either of the following formats:
FAMILY <target family> = <primary family>
OTHERWISE <alternate family>; FAMILY <target family>
= <primary family> ONLY;

For an introduction to the FAMILY task attribute, refer to Equating the Family Statement in
Section 5, Running Tasks.

In some cases you might want to analyze the FAMILY value of the job or of a task. You can
use the resulting information to build a new FAMILY value that will ensure that the job or
task can use all the files it needs to.

The following pages explain how to extract the target family, primary family, and alternate
family from a family statement.

Assumptions

For these subroutines to work correctly, the FAMILY value that is passed to them must
follow valid syntax.

13–18 8807 7391-006


Working with Data

Extracting the Target Family


SUBROUTINE FINDTARGET (STRING FAMVAL, % Receives FAMILY statement
STRING TARGET); % Returns target family
BEGIN
TARGET := FAMVAL;
REMOVELEAD (TARGET); % Remove leading blanks
IF LENGTH(TARGET) GTR 0 THEN % Check for empty string
BEGIN
TARGET := TAIL(TARGET,NOT " "); % Remove first word, FAMILY
REMOVELEAD (TARGET); % Remove leading blanks
TARGET := HEAD(TARGET, NOT "="); % Drop all chars from = onward
REMOVETRAIL (TARGET); % Remove trailing blanks
END;
END;

Extracts the target family from a family statement.

Example Call and Result


FAMSTR := "FAMILY DISK = DEVPK OTHERWISE ARCH";
FINDTARGET(FAMSTR, TARGSTR);

After FINDTARGET runs, TARGSTR has the value ″DISK″.

Explanation

REMOVELEAD and REMOVETRAIL

Remove leading and trailing blanks from a string. Refer to “Removing Leading and Trailing
Blanks” earlier in this section.

Extracting the Primary Family


SUBROUTINE FINDPRIMARY (STRING FAMVAL, % Receives FAMILY statement
STRING FAMPRIM); % Returns primary family
BEGIN
FAMPRIM := FAMVAL;
IF LENGTH(FAMPRIM) GTR 0 THEN % Check for empty string
BEGIN
FAMPRIM := TAIL(FAMPRIM,NOT "="); % Delete all before "="
FAMPRIM := DROP(FAMPRIM,1); % Delete "="
REMOVELEAD (FAMPRIM); % Removing leading blanks
FAMPRIM := HEAD(FAMPRIM, NOT " ");% Delete all but first word
END
ELSE FAMPRIM := "DISK";
END;

Extracts the primary substitution family from a family statement.

Example Call and Result


FAMSTR := "FAMILY DISK = DEVPK OTHERWISE ARCH";
FINDPRIMARY(FAMSTR, PRIMSTR);

8807 7391-006 13–19


Working with Data

After FINDPRIMARY runs, PRIMSTR has the value ″DEVPK″.

Explanation

REMOVELEAD

Removes leading blanks from a string. Refer to “Removing Leading and Trailing Blanks”
earlier in this section.

Extracting the Alternate Family


SUBROUTINE FINDALT (STRING FAMVAL, % Receives FAMILY statement
STRING FAMALT); % Returns alternate family
BEGIN
INTEGER FLEN, % Length of entire FAMILY statement
SLEN; % Length of alternate family name
REMOVELEAD (FAMVAL); % Delete leading blanks
REMOVETRAIL (FAMVAL); % Delete trailing blanks
FLEN := LENGTH(FAMVAL); % Record length of FAMILY statement
% Make sure at least one blank is present
IF FAMVAL = HEAD(FAMVAL, NOT " ") THEN
BEGIN
FAMALT := "";
RETURN;
END;
% Find length of last word by searching backwards for blanks
SLEN := 1;
WHILE TAKE(DROP(FAMVAL,FLEN - SLEN),1) NEQ " " DO
SLEN := SLEN + 1;
SLEN := SLEN - 1;
% Make sure value is not ONLY
FAMALT := DROP(FAMVAL, FLEN - SLEN);
IF FAMALT = "ONLY" THEN
FAMALT := "";
END;

Extracts the alternate substitution family, if there is one.

Example Call and Result


FAMSTR := "FAMILY DISK = DEVPK OTHERWISE ARCH";
FINDALT(FAMSTR, ALTSTR);

After FINDALT runs, ALTSTR has the value ″ARCH.″

Example Call and Result


TESTSTR := "FAMILY DISK = DEVPK ONLY";
FINDALT(FAMSTR, ALTSTR);

There is no secondary family. Therefore, after FINDALT runs, TESTSTR is a null string (″″).

Explanation

REMOVELEAD and REMOVETRAIL

13–20 8807 7391-006


Working with Data

Remove leading or trailing blanks from a string. Refer to “Removing Leading and Trailing
Blanks” earlier in this section.

Converting a String to Uppercase or Lowercase Characters


Use the UPPERCASE and LOWERCASE string primary translate functions to convert all
characters in a string expression to uppercase or lowercase. These functions generate a
string that is the same length as the specified string expression, with all characters
converted to either upper or lower case values.

Examples

The following examples illustrate the LOWERCASE and UPPERCASE functions:


STR1:="a1b2c3d4e5f6g7";
STR2:= UPPERCASE(STR1); % RESULT = "A1B2C3D4E5F6G7"
STR2:= LOWERCASE("TRANSLATEME"); % RESULT = "translateme"

Converting between Strings and Numbers


REAL RVAL := 17.809;
INTEGER IVAL := 6;
STRING SVAL;
SVAL := STRING(IVAL,*); % Returns "6"
SVAL := STRING(RVAL,*); % Returns "17"
IVAL := DECIMAL(SVAL); % Returns 17

Use the STRING function to convert an integer or real value to a string. Note that
• If you convert a real value, the fractional part is rounded off to the nearest integer.
• If the value is negative, it is converted to positive.

Use the DECIMAL function to convert a string to an integer.

8807 7391-006 13–21


Working with Data

13–22 8807 7391-006


Section 14
Communicating with the Operator

You can design a WFL job to display information to an operator or accept information from
an operator.

Note: Your operators probably do not want to spend their whole day reading and
responding to WFL job messages. Further, operator input is subject to typographical
errors. For these reasons, it is best to use the features in this section sparingly.

Displaying Information to Operators


A WFL job can display information to operators using any of the following features:
DISPLAY statements, INSTRUCTION statements, and FETCH specifications.

DISPLAY: Displaying a Message Temporarily


MYSELF(DISPLAYONLYTOMCS = TRUE);
DISPLAY "INCORPORATING NEW DATA - MAY TAKE AWHILE";

DISPLAY

Displays a string of text to the operator as part of the system messages.

Note that on a busy system, many system messages appear each minute. There is no
guarantee that the DISPLAY message will stand out enough to be noticed by an operator.

DISPLAYONLYTOMCS = TRUE

If the job is started from a CANDE session, this attribute causes DISPLAY messages to
appear only in the originating CANDE session, and not at an ODT. (If the job is started from
an ODT, the DISPLAYONLYTOMCS value is ignored and DISPLAY messages do appear at
an ODT.) Use this attribute if you expect the job to be started from CANDE and you believe
the DISPLAY messages will interest only the person who started the job.

8807 7391-006 14–1


Communicating with the Operator

INSTRUCTION: Storing a Message for Later Display


INSTRUCTION 1 INPUT TAPE IS IN TAPE RACK 3.;
RUN (JOSEPH)OBJECT/TEST/ALGOL/TASK;

INSTRUCTION 2 NOTIFY THE CONTROLLER WHEN COMPLETED.;


RUN (JOSEPH)OBJECT/TEST/ALGOL/TASK;

Stores information that an operator can display at any time with the IB (Instruction Block)
system command.

For example, if the WFL job has mix number 7645, the following command displays the
most recent instruction block:
7645 IB

If the WFL job has mix number 7645, the following command displays instruction block
number 2:
7645 IB 2

The advantage of instruction blocks is that they remain available to the operator as long as
the WFL job is running. The disadvantage of instruction blocks is that nothing prompts the
operator to use the IB command. The operator has to know in advance that instruction
blocks exist for a particular WFL job.

FETCH: Forcing the Operator to Read a Message


BEGIN JOB DBDATA;
FETCH = "THIS JOB NEEDS THREE TAPE DRIVES";
.
.
.

Prevents a job from running until the operator acknowledges the presence of the FETCH
specification. The job appears in the waiting entries display with the message
REQUIRES FETCH, QUEUE = <queue number>

The operator can use a command of the following form to display the FETCH specification:
<mix number> PF

The operator can use a command of the following form to cause the job to be initiated:
<mix number> OK

If the system option NOFETCH is set, then the system does not suspend jobs with
FETCH specifications. However, an operator can still use the PF command to display
FETCH specifications. An operator can set or reset the NOFETCH system option with the
OP (Options) system command.

14–2 8807 7391-006


Communicating with the Operator

Receiving Information from Operators


Section 13, Working with Data, introduced the topic of job parameters, which you can use
to enable a job to receive input from the operator. The operator must supply job
parameters in the START statement. However, a WFL job can also use any of the
following techniques to receive input from the operator after the job is running:
• Simple WAIT statement
• TASKVALUE task attribute
• ACCEPT function
• SW1 through SW8 task attributes

WAIT: Waiting for a HI Command


DISPLAY "Enter HI when AUDITJOB is finished";
WAIT;

Displays a message and then waits for the operator to enter a HI command. If the mix
number of the job is 9477, the HI command is of the following form:
9477 HI

Note that the job will also resume if any task of the job changes status.

While the job is waiting, it does not appear in the waiting entries display. That is why this
example uses a DISPLAY message to attract the operator’s attention.

TASKVALUE: Waiting for a Number


WHILE MYSELF(TASKVALUE) = 0 DO
WAIT;
IF MYSELF(TASKVALUE) = 3 THEN ...

Waits for the operator to supply a TASKVALUE. For example, if the mix number of the job
is 1164, an operator could enter a command such as the following:
1164 HI 3

The number after the HI is an assignment to the TASKVALUE task attribute. The WHILE
statement is structured to make the job resume waiting if no TASKVALUE assignment
was entered. For example, if a task of the job changes status, the job momentarily
becomes active but then returns to a waiting state.

Once the job has definitely awakened, it can make decisions based on the TASKVALUE
that was entered by the operator.

8807 7391-006 14–3


Communicating with the Operator

ACCEPT: Waiting for a String


STRING AXSTR;
AXSTR := ACCEPT ("Enter AX BRIEF or AX LONG");
IF AXSTR = "BRIEF" THEN ...

Suspends the job and waits for operator input. The job appears in the waiting entries
display with the message
ACCEPT:Enter AX BRIEF or AX LONG.

If the mix number of the job is 8364, the operator can restart the job with a command such
as the following:
8364 AX BRIEF

This command assigns the value ″BRIEF″ to the string AXSTR.

SW1 through SW8: Waiting for Booleans


WAIT(MYSELF(SW1));

Waits until the operator sets the Boolean task attribute SW1 to TRUE. If the mix number
of the job is 4875, the operator can make this assignment with the following command:
4875 SW1 TRUE

Note that the job might take several seconds before it notices the new SW1 value and
resumes execution.

The task attributes from SW1 through SW8 all work in the same way.

14–4 8807 7391-006


Section 15
Security

WFL includes statements to perform a variety of functions related to files, including


copying, removing, retitling, executing, and reading or changing file attributes. All of these
actions are subject to security restrictions.

To understand whether a job can perform a particular action on a file, you must first
understand:
• The security restrictions applying to the particular file
• The privileges of the job
• This section presents a brief introduction to the security features available to WFL
jobs.

Protecting Disk Files

Default Usercode
If you log on to MARC or CANDE under a usercode, that usercode becomes the default
usercode for any files that you create. Similarly, if a WFL job runs under a usercode, then
files created by that job default to that usercode.

Default SECURITYTYPE
By default, files are created with SECURITYTYPE = PRIVATE. This means that the files can
be accessed only by users who have the same usercode as the file or who are privileged.

Nonusercoded Files
Files that begin with an asterisk (*) instead of a usercode are referred to as nonusercoded
files. These files have unusual properties because they are intended for use by many
different users or by the operating system. Thus,
• On a typically configured system, nonusercoded files have a default SECURITYTYPE
of PUBLIC and SECURITYUSE of IO. This default ensures that anyone can read or
execute these files.
• However, only privileged or nonusercoded processes can create or write to
nonusercoded files.

8807 7391-006 15–1


Security

Changing File Security


SECURITY REPGEN/INPUT ON ACCT PUBLIC IO;

Changes the security of the specified file. PUBLIC IO is only one of several possible
security settings, of which the following are the most useful:
• PUBLIC IO
Makes the specified file available to anyone, for reading, writing, or execution.
• PUBLIC IN
Makes the specified file available to anyone, for reading or execution.
• PUBLIC SECURED
Makes the specified file available to anyone, for execution only. This setting is
intended for object code files.
• PRIVATE
Restricts the file to those users who have the same usercode as the file or who are
privileged.

The SECURITY statement has many additional options, which are described in detail in the
WFL Programming Reference Manual.

Specifying Multiple Files and Directories


SECURITY CUST/DATA, DAILY/= FROM ACCT,
OBJECT/DBREPORTER FROM SERV PUBLIC IN;

Makes the specified files available to anyone for reading or execution.


• DAILY/=
Affects all the files on the specified directory.
• FROM
Specifies the family for one or more files or directories. Thus, this statement looks for
both CUST/DATA and DAILY/= on the ACCT family and looks for
OBJECT/DBREPORTER on the SERV family.

Understanding Job Privileges


By default, a WFL job has access to files that are public or that are stored under the
usercode of the job. To access other files, the WFL job must have appropriate privileges.
The following paragraphs discuss the privileges required to perform various actions on
files that are private and stored under a usercode different from that of the job.

The following discussion makes a number of references to usercodes with various types
of privileged status. Such privileges are assigned by the security administrator; refer to the
I for details.

15–2 8807 7391-006


Security

COPY or ADD
To ensure that you can copy any files, regardless of their usercode or security attributes,
do any of the following:
• Submit the copy request from an ODT, without any usercode.
• Submit the copy request from a usercode that has PU status or LOCALCOPY status.

CHANGE
To ensure that you can change the titles of any files, regardless of their usercode or
security attributes, do any of the following:
• Enter the CHANGE statement as a single statement at an ODT.
• Submit the change request from a usercode that has PU status or CHANGE status.

REMOVE
To ensure that you can remove any files, regardless of their usercode or security
attributes, do any of the following:
• Enter the REMOVE statement as a single statement at an ODT.
• Submit the REMOVE statement from a usercode that has PU status or REMOVE
status.

RUN
To ensure that you can run any program, regardless of its usercode or security attributes,
submit the RUN request from a usercode that has PU status or EXECUTE status.

Note that the RUN statement does not receive any special privileges from being
submitted from an ODT.

START
To ensure that you can start any WFL job, regardless of its usercode or security attributes,
do any of the following:
• Enter the START statement as a single statement at an ODT.
• Submit the START request from a usercode that has PU status or READ status. Note
that EXECUTE status has no effect on the START statement.

8807 7391-006 15–3


Security

15–4 8807 7391-006


Section 16
Examining the System Environment

You can use WFL functions to find out the current date and time, or to find out information
about the system where the job is running.

Getting the Date and Time


Making Decisions Based on the Date
IF TIMEDATE(DAY) = "FRIDAY" THEN
RUN OBJECT/REPORT("WEEKLY");

Putting the Date in a File Title


COPY DBAUDIT/LOG AS DBAUDIT/LOG/#TIMEDATE(YYYYMMDD)
FROM DBFAM(PACK) TO ARCH(PACK);

Description of the Formats

The following table shows examples of date and time formats and identifies the
TIMEDATE parameter to use for each format. The examples reflect a current date of
February 11, 1998 and a current time of 18 seconds after 2:43 p.m.

Example Output TIMEDATE Call

144318 TIMEDATE (HHMMSS)

19980211144318 TIMEDATE (YYYYMMDDHHMMSS)

2:43 PM WEDNESDAY, FEBRUARY 11, 1998 TIMEDATE (DISPLAY)


FEBRUARY TIMEDATE (MONTH)

WEDNESDAY TIMEDATE (DAY)


3 TIMEDATE (DAYNUMBER) (Note that day
numbers are zerorelative, with Sunday as
day 0)

98042 TIMEDATE (YYDDD)

980211 TIMEDATE (YYMMDD)

021198 TIMEDATE (MMDDYY)

110298 TIMEDATE (DDMMYY)

8807 7391-006 16–1


Examining the System Environment

Example Output TIMEDATE Call

1998042 TIMEDATE (YYYYDDD)


19980211 TIMEDATE (YYYYMMDD)

02111998 TIMEDATE (MMDDYYYY)

11021998 TIMEDATE (DDMMYYYY)

Getting System Information


You can use WFL expressions to return the following information about the system:
• Hostname
• System serial number
• System type
• MCP level

Hostname
IF MYSELF(HOSTNAME) = "ATHENS" THEN
MYSELF(FAMILY DISK = MFC OTHERWISE DISK);

Changes the FAMILY statement for the job if the job is being run on the host named
ATHENS.

Serial Number
COPY *SUMLOG/ #SYSTEM(SERIALNUMBER) /091898/=
FROM PACK(PACK) TO OPS(PACK);

Copies all system log files on family PACK that were released on the date September 18,
1998. This statement uses the SYSTEM(SERIALNUMBER) function because titles of
released log files have the following form:
SUMLOG/<system serial number>/<date>/<log number>

System Type
CASE SYSTEM(TYPE) OF
BEGIN
("A18"): COPY *OBJECT/A18/REPGEN AS *OBJECT/REPGEN
FROM PACK(PACK,HOSTNAME=MPA15C) TO DISK(PACK);
ELSE: COPY *OBJECT/DEFAULT/REPGEN AS *OBJECT/REPGEN
FROM PACK(PACK,HOSTNAME=MPA15C) TO DISK(PACK);
END;

16–2 8807 7391-006


Examining the System Environment

Chooses a particular file to copy to the local host, depending on the type of system the
current host is. In this example, it is assumed that there are several different versions of
the program REPGEN. Each version was compiled with the TARGET compiler option set
to optimize the program for a particular type of system. The example checks the system
type of the local host to decide which version of the program to copy.

MCP Level
CASE TAKE(SYSTEM(MCPLEVEL),4) OF
BEGIN
("44.1"): COPY *OBJECT/441/REPGEN AS *OBJECT/REPGEN
FROM PACK(PACK,HOSTNAME=MPA15C) TO DISK(PACK);
ELSE: COPY *OBJECT/DEFAULT/REPGEN AS *OBJECT/REPGEN
FROM PACK(PACK,HOSTNAME=MPA15C) TO DISK(PACK);
END;

Chooses a particular file to copy to the local host, depending on the MCP level of the
current host. In this example, it is assumed that there are several different versions of the
program REPGEN. Each version was compiled under a different MCP level. The example
checks the system type of the local host to decide which version of the program to copy.

8807 7391-006 16–3


Examining the System Environment

16–4 8807 7391-006


Section 17
Designing Jobs for Restarts

WFL jobs automatically restart after being interrupted by a system halt/load or a RESTART
(Restart Jobs) system command. This section introduces the following topics related to
job restarts:
• Understanding where jobs restart
• Restoring attribute values
• Restarting copies
• Aborting the job on restart

For a more detailed discussion of job restarts, refer to the Task Management
Programming Guide.

Planning Simple Job Restarts


Rationale

After a halt/load, the system recovers any WFL jobs that were in progress and inserts
them in job queues again. When a job is selected from a queue, the job resumes
execution from the last point in the job where a successful job rollout was taken. A job
rollout stores information that helps in restarting the job. The system attempts a job rollout
before each task initiation statement (such as COMPILE, COPY, PROCESS, and RUN) as
well as before or after certain other statements.

Variables and job parameters retain their values across a halt/load. However, values
assigned to a task or file attribute outside the declaration are lost. You can use the ON
RESTART statement to restore task or file attribute values or to take other actions
immediately following a halt/load.

Example
100 BEGIN JOB RUNUPDATES;
110
120 TASK T1(PRIORITY = 60);
130
140 SUBROUTINE INIT;
145 BEGIN
150 IF TIMEDATE(DAY) = "FRIDAY" THEN
160 T1(TASKVALUE = 1);
165 END;
170

8807 7391-006 17–1


Designing Jobs for Restarts

180 ON RESTART,
185 BEGIN
190 INIT;
195 END;
200
210 INIT;
220
230 RUN OBJECT/DB/UPDATE [T1];
240
250 RUN OBJECT/INTEREST/CALC;
260 FILE SOURCE = CUST/BALANCES ON ACCT;
270
280 END JOB

Explanation

This example runs two programs, OBJECT/DB/UPDATE and OBJECT/INTEREST/CALC


with the following attributes:
• TASK T1(PRIORITY = 60)
A task variable declaration that includes a task attribute assignment. The system
automatically preserves this value across a halt/load.
• T1(TASKVALUE = 1);
A task attribute assignment outside of the original declaration of the task variable. This
value is not preserved across a halt/load.
• SUBROUTINE INIT;
If today is Friday, assigns a task attribute to the task variable T1. By placing this
statement within a subroutine, we make it simple to invoke the statement at both line
190 and line 210.
• ON RESTART, . . .
If a halt/load occurs, invokes the subroutine INIT.
• FILE SOURCE = CUST/BALANCES ON ACCT;
A file equation included in a RUN statement. The system automatically performs this
equation if the RUN statement is executed again after a halt/load.

Determining the Job Restart Point

If the halt/load occurs while the task OBJECT/DB/UPDATE is running, then after the
halt/load
• The ON RESTART statement invokes subroutine INIT.
• The job restarts at line 230 and runs OBJECT/DB/UPDATE again.
• The job continues to line 250 and runs OBJECT/INTEREST/CALC.

17–2 8807 7391-006


Designing Jobs for Restarts

If the halt/load occurs while the task OBJECT/INTEREST/CALC is running, then after the
halt/load
• The ON RESTART statement invokes subroutine INIT.
• The job restarts at line 250 and runs OBJECT/INTEREST/CALC again.

Restarting Copies
Suppose a COPY statement is copying files between hosts, and a halt/load occurs. After
the halt/load, the WFL job restarts and the copy request is resubmitted. There is a risk that
the copy request may resume before the networking software and connections are
reestablished. If this problem occurs, the copy request fails. To learn how to prevent this
problem, refer to “Ensuring the Hosts Are Available” in Section 7, Copying Files.

Aborting the Job on Restart


BEGIN JOB;
ON RESTART,
ABORT "Aborting job because of automatic restart";
RUN OBJECT/PAYROLL;
END JOB

Aborts the job if it is interrupted by a halt/load. This action is appropriate if the job runs
tasks that cannot be restarted safely. For example, suppose that OBJECT/PAYROLL prints
paychecks. After OBJECT/PAYROLL has printed half the paychecks, a halt/load occurs. By
default, the WFL job restarts OBJECT/PAYROLL from scratch after the halt/load. As a
result, OBJECT/PAYROLL prints some paychecks a second time and those employees
effectively receive twice their normal pay

Rules

When you create a WFL job, find out whether its tasks can safely be restarted. Take
precautions to prevent restarts if necessary.

8807 7391-006 17–3


Designing Jobs for Restarts

17–4 8807 7391-006


Section 18
Debugging WFL Jobs and Tasks

WFL jobs are rarely perfect when you first create them. After you write a WFL job, you
typically must spend some time correcting errors in the job. This process is referred to as
debugging . The following topics introduce basic techniques that will help you to debug
syntax errors and run-time errors.

Correcting Syntax Errors


Syntax errors are errors that the WFL compiler detects while compiling the job. Once you
understand the following topics, it is usually easy to locate and correct syntax errors:
• Starting a job for syntax checking only
• Format of syntax error messages
• Cascading syntax errors
• Delayed syntax errors

Starting a Job for Syntax Checking Only


START INTEG/JOB SYNTAX

Compiles the job INTEG/JOB and displays messages indicating if there are any syntax
errors. However, the SYNTAX option keeps the job from actually being executed, even if it
compiles without error.

If you use the SYNTAX option, you do not need to include any job parameters, even if the
job would normally require them.

Format of Syntax Error Messages


Example Job
00002000 BEGIN JOB INTEG/JOB(STRING PARAM);
00004000
00006000 FAM := FILE INTEG/INPUT IS RESIDENT;
00008000
00010000 IF NOT FAM AND PARAM NEQ "" THEN
00012000 RUN OBJECT/FULLINT (PARAM);
00014000 ELSE
00016000 RUN OBJECT/SMALLINT;

8807 7391-006 18–1


Debugging WFL Jobs and Tasks

00018000
00020000 END JOB

Syntax Errors
START INTEG/JOB SYNTAX
#RUNNING 5562
6000 FAM := FILE INTEG/INPUT IS RESIDENT;
*
ERROR: UNDECLARED IDENTIFIER
10000 IF NOT FAM AND PARAM NEQ "" THEN
*
ERROR: UNDECLARED IDENTIFIER
10000 IF NOT FAM AND PARAM NEQ "" THEN
*
ERROR: BOOLEAN EXPRESSION EXPECTED
#SNTX

Starts a job for syntax checking in CANDE. The resulting messages describe three syntax
errors. Each syntax error description is three lines long, and has the following format:
<line number> <line text>
<asterisk marking error position>
ERROR: <error name>

The first error has the following meaning:


• The error occurred on line 6000.
• The asterisk is displayed below the position where the error was detected. Thus, the
error was detected at the word FAM on line 6000.
• The error message is UNDECLARED IDENTIFIER. In other words, you forgot to
declare the identifier FAM before you used it.

You could correct this error by adding the following declaration to the job:
5000 BOOLEAN FAM;

Cascading Syntax Errors


Suppose that you correct the first of the three syntax errors in the previous example. Then
you start the job again. This time you see the following messages:
START INTEG/JOB SYNTAX
#RUNNING 5572
#

You fixed only the first syntax error, but all three syntax errors went away. The fact is that
all three errors were really the result of a single problem. The undeclared identifier FAM
was used at both line 6000 and line 10000.

Further, two different errors resulted at line 10000. The error UNDECLARED IDENTIFIER
is straightforward. The second error, BOOLEAN EXPRESSION EXPECTED, results
because FAM was used within a larger Boolean expression.

18–2 8807 7391-006


Debugging WFL Jobs and Tasks

Note: It is rarely worthwhile to try to correct all syntax errors at one time. Instead, fix the
first syntax error and any others that you understand, then submit the job again. The new
set of syntax messages might be much shorter than the original one.

Delayed Syntax Errors


Rationale

The WFL compiler reports an error when it encounters something that is syntactically
invalid. However, the actual cause of the error might be a mistake made much earlier in
the job. The following example illustrates this problem.

Example Job
00000100 BEGIN JOB DBDATA/JOB(STRING PARAM);
00000110
00000120 SUBROUTINE OUTERBLANKS(STRING TYPEVAL);
00000130 % This subroutine removes leading and trailing blanks
00000140 % from a string, but not embedded blanks (in case we
00000150 % someday want to allow a file title as a value)
00000160 BEGIN
00000170 BOOLEAN DONE;
00000180 STRING FRONT, BACK;
00000190 DONE := FALSE;
00000200 WHILE NOT DONE DO % Remove leading blanks
00000210 BEGIN
00000220 IF LENGTH(TYPEVAL) GTR 0 THEN
00000230 IF TAKE(TYPEVAL,1) = " " THEN
00000240 TYPEVAL := DROP(TYPEVAL,1)
00000250 ELSE DONE := TRUE
00000260 ELSE DONE := TRUE;
00000270 DONE := FALSE;
00000280 WHILE NOT DONE DO % Remove trailing blanks
00000290 BEGIN
00000300 IF LENGTH(TYPEVAL) GTR 0 THEN
00000310 IF DROP(TYPEVAL,LENGTH(TYPEVAL) - 1) = " " THEN
00000320 TYPEVAL := TAKE(TYPEVAL,LENGTH(TYPEVAL) - 1)
00000330 ELSE DONE := TRUE
00000340 ELSE DONE := TRUE;
00000350 END;
00000360 END OUTERBLANKS;
00000370
00000380 STRING PARAMBUF;
00000390
00000400 PARAMBUF := PARAM;
00000410 OUTERBLANKS (PARAMBUF);
00000420
00000430 RUN OBJECT/DBDATAGEN (PARAMBUF);
00000440
00000450 END JOB

8807 7391-006 18–3


Debugging WFL Jobs and Tasks

Syntax Errors
START DBDATA/JOB SYNTAX
#RUNNING 5584
360 END OUTERBLANKS;
*
ERROR: END OF STATEMENT EXPECTED
380 STRING PARAMBUF;
*
ERROR: A STATEMENT CANNOT BEGIN WITH THIS
400 PARAMBUF := PARAM;
*
ERROR: UNDECLARED IDENTIFIER
410 OUTERBLANKS (PARAMBUF);
*
ERROR: UNDECLARED IDENTIFIER
410 OUTERBLANKS (PARAMBUF);
*
ERROR: STRING EXPRESSION EXPECTED
430 RUN OBJECT/DBDATAGEN (PARAMBUF);
*
ERROR: UNDECLARED IDENTIFIER
***** ERROR LIMIT EXCEEDED, COMPILATION ABORTED *****
#SNTX

Explanation

Reports a number of errors. You should begin by concentrating on the first error listed:
END OF STATEMENT EXPECTED.

The problem is a missing END clause. For every BEGIN clause, there must be a matching
END clause. Because BEGIN...END pairs can be nested within each other, the compiler
has no way of knowing which END clause you forgot to put in. The error is reported
relative to line 360 because the subroutine terminates there, and an END was omitted
somewhere in that subroutine.

This type of problem is easy to solve if you properly format your job. The example shows
good formatting practice. The matching BEGIN and END clauses are each indented the
same amount. The BEGIN at line 290 and the END at line 350 begin in the same column.
But the BEGIN clause at line 210 does not have an END clause to match it. You can fix the
error by adding an END clause between lines 260 and 270.

If you fix the error and start the job again, you will find that all the other syntax errors have
gone away. They were side-effects of the missing END clause.

18–4 8807 7391-006


Debugging WFL Jobs and Tasks

Correcting Run-Time Errors


After you have eliminated any syntax errors in your WFL job, you need to start the job
again to check for run-time errors. These are errors that occur after job compilation is
complete, while the job is actually executing. While the job is executing, you might also
discover errors in tasks that are run by the job. The following topics will help you to correct
run-time errors in the job and its tasks:
• Using job messages
• Data-dependent errors
• Adding DISPLAY statements
• Using the job summary
• Requesting program dumps for tasks

Using Job Messages


Example Job
00000100 BEGIN JOB REPORT/JOB(STRING PARAM);
00000110
00000120 BOOLEAN DONE := FALSE;
00000130 STRING PARAMBUF, FRONT, BACK;
00000140
00000150 PARAMBUF := PARAM;
00000160
00000200 WHILE NOT DONE DO % Remove leading blanks
00000210 BEGIN
00000230 IF TAKE(PARAMBUF,1) = " " THEN
00000240 PARAMBUF := DROP(PARAMBUF,1)
00000250 ELSE DONE := TRUE;
00000400 END;
00000420
00000422 RUN OBJECT/DATA/PREP;
00000424
00000430 RUN OBJECT/REPGEN (PARAMBUF);
00000440
00000450 END JOB

Runs the programs OBJECT/DATA/PREP and OBJECT/REPGEN. The job accepts a single
parameter, and removes leading blanks from the parameter before passing the value to
OBJECT/REPGEN.

Run-Time Errors
START REPORT/JOB("TERSE")
#UPDATING
#RUNNING 6811
#JOB 6812 IN QUEUE 2
#
#6812 BOJ REPORT/JOB
#6812\6813 BOT (ICS)OBJECT/DATA/PREP ON SERV
#6812\6813 EOT (ICS) (ICS)OBJECT/DATA/PREP ON SERV

8807 7391-006 18–5


Debugging WFL Jobs and Tasks

#6812 PARAMETER MISMATCH @ 10B2:0002:0 @ (00000430)


#6812\6812 P-DS (ICS) JOB REPORT/JOB

Starts a job in CANDE, and displays the resulting run-time error. The method of displaying
job messages depends on whether you started the job from CANDE, MARC, Operations
Center, or the ODT. For details, refer to Section 3, Submitting WFL Statements and Jobs.

Error messages have one of the following formats:


<job number> <text> @ <code segment> @ <seq number>
<job number> \ <mix number> <text> @ <code segment> @ <seq number>

Note: CANDE displays WFL messages if the CANDE session option MSG is set. If you
are not seeing these messages, try entering the command SO MSG . This command
affects only the current CANDE session. To set the MSG option permanently, ask your
system administrator to set the CANDEGETMSG attribute for your usercode.

Use the following steps to determine the cause of the error:


1. Determine whether the error was caused by the job or a task. To do this, examine the
mix number in the error message. Compare this with the job number in the BOJ
message. If the numbers match, then the error was committed by the WFL job itself.
Otherwise, look at the second number in each BOT message until you find a number
matching the mix number in the error message. That BOT message identifies the task
that committed the error.
In the preceding example, the error message began with 6812 . This number also
occurs in the BOJ message. The error was therefore committed by the WFL job itself.
2. Determine the statement that caused the error. Look at the sequence number in the
error message and examine the record in the WFL job that has that sequence number.
In this example, the error was committed by the RUN statement at line 430.
3. Examine the message text, which explains the type of error. The PARAMETER
MISMATCH text in this example means that the wrong number or type of parameters
was passed to a task.
Often, the message text is sufficient to explain the nature of the error. For further
information about particular types of errors, refer to the following sources:
• PARAMETER MISMATCH
Refer to Passing Parameters to a Task in Section 5, Running Tasks.
• Errors in COPY requests
Refer to Determining Why a Copy Failed in Section 7, Copying Files.
• Other errors
Refer to the System Messages Support Reference Manual.
You can ignore the <code segment> part of the message. This information serves the
same purpose as the <sequence number>, but is harder to use.

18–6 8807 7391-006


Debugging WFL Jobs and Tasks

Data-Dependent Errors
Rationale

A WFL job might run successfully on one occasion, but commit an error on another
occasion. The differences result because the same job might be processing different data
on different occasions. Consider the job in the previous example, Using Job Messages. If
you start that job with a null parameter (″″) or a parameter containing only blanks (″ ″), a
new type of error results, as shown in the following example.

Example
START REPORT/JOB (" ")
#RUNNING 6842
#JOB 6843 IN QUEUE 2
#
#6843 BOJ DBDATA/JOB
#6843 BAD PARAMETER VALUE FOR 'TAKE' FUNCTION @ (00000230)
#6843\6843 P-DS (JOSEPH) JOB DBDATA/JOB

Statement That Caused the Error

At line 230 in the job, you will find the following TAKE function:
00000230 IF TAKE(PARAMBUF,1) = " " THEN

This function returns the first character of the string PARAMBUF. If PARAMBUF contains
at least one character, no error occurs. However, if the string PARAMBUF is empty, there
is no first character to return and an error results.

Fixing the Problem

Before using the TAKE function or the DROP function, you should generally check the
length of the string. You can fix the problem in this job by adding the two statements
highlighted in the following example:
00000200 WHILE NOT DONE DO % Remove leading blanks
00000210 BEGIN
00000220 IF LENGTH(PARAMBUF) GTR 0 THEN
00000230 IF TAKE(PARAMBUF,1) = " " THEN
00000240 PARAMBUF := DROP(PARAMBUF,1)
00000250 ELSE DONE := TRUE;
00000260 ELSE DONE := TRUE;
00000400 END;

8807 7391-006 18–7


Debugging WFL Jobs and Tasks

Adding DISPLAY Statements


Rationale

One of the basic techniques for debugging any program is to display the values of
variables at various points during execution. To begin with, you should find out which
variables are used in the statement that causes the error. You should then arrange to
display the values immediately before the statement that causes the error.

The Test and Debug System (TADS) exists to perform this type of task for a number of
different programming languages. However, TADS is not available for debugging WFL
jobs. To get a similar effect in WFL, you can include DISPLAY statements to display the
value of variables.

The following example is based on the example in Using Job Messages except that a
DISPLAY message is added.

Example Job
00000100 BEGIN JOB DBDATA/JOB(STRING PARAM);
00000110
00000120 BOOLEAN DONE := FALSE;
00000130 STRING PARAMBUF, FRONT, BACK;
00000140
00000150 PARAMBUF := PARAM;
00000160
00000200 WHILE NOT DONE DO % Remove leading blanks
00000210 BEGIN
00000215 DISPLAY PARAMBUF;
00000230 IF TAKE(PARAMBUF,1) = " " THEN
00000240 PARAMBUF := DROP(PARAMBUF,1)
00000250 ELSE DONE := TRUE;
00000400 END;
00000420
00000422 RUN OBJECT/DATA/PREP;
00000424
00000430 RUN OBJECT/REPGEN (PARAMBUF);
00000440
00000450 END JOB

Run-Time Messages
START (" ")
#RUNNING 6859
#JOB 6860 IN QUEUE 2
#
#6860 BOJ DBDATA/JOB
#6860 DISPLAY: .
#6860 DISPLAY: .
#6860 DISPLAY:.
#6860 BAD PARAMETER VALUE FOR 'TAKE' FUNCTION @ (00000230)
#6860\6860 P-DS (JOSEPH) JOB DBDATA/JOB

18–8 8807 7391-006


Debugging WFL Jobs and Tasks

The DISPLAY statement shows the value of the PARAMBUF variable each time the
WHILE statement repeats itself. (Note that DISPLAY appends a period (.) to any value that
it displays.) Thus, these messages show that PARAMBUF started out as a string of two
blanks, then a string with one blank, then an empty string. Then the error occurred.

You might therefore guess that the problem is caused by the string being empty. In this
case, that guess would be correct. The TAKE function could not handle an empty string.

Using the Job Summary


Rationale

The job summary is a printout that records the major events in the execution of a job. If
you are not able to watch the job messages while the job is running, you can sometimes
figure out problems by looking at the job summary later.

Example Job Summary


Wed, Aug 8, 2001 17:49:12, SYSTEM SERIAL: 539, A12 MCP:
*SYSTEM/ASD/MCP/48138J 48.138.1099, HOSTNAME: MP021

W O R K F L O W S T A T E M E N T S

00000100 BEGIN JOB DBDATA/JOB(STRING PARAM);


PARAM = " "
00000105 JOBSUMMARY = UNCONDITIONAL;
00000115
00000120 BOOLEAN DONE := FALSE;
00000130 STRING PARAMBUF, FRONT, BACK;
00000140
00000150 PARAMBUF := PARAM;
00000160
00000180 % PRINT TEMP/DAT;
00000200 WHILE NOT DONE DO % Remove leading blanks
00000210 BEGIN
00000215 DISPLAY PARAMBUF;
00000220 % IF LENGTH(PARAMBUF) GTR 0 THEN
00000230 IF TAKE(PARAMBUF,1) = " " THEN
00000240 PARAMBUF := DROP(PARAMBUF,1)
00000250 ELSE DONE := TRUE;
00000260 % ELSE DONE := TRUE;
00000400 END;
00000420
00000430 RUN OBJECT/REPGEN (PARAMBUF);
00000440
00000450 END JOB

J O B S U M M A R Y

Wed, Aug 8, 2001

17:49:12 BOJ 7074 DBDATA/JOB.


JOB ENTERED SYSTEM: 08/08/2001 17:49:12

8807 7391-006 18–9


Debugging WFL Jobs and Tasks

FROM WFL 48.138


QUEUE: 2, ORIGINATING LSN: 221 MCS: 2
STACK NUMBER: 03A0, PRIORITY: 50, SOURCENAME:
OCJFM_1/CANDE/1.
USERCODE: ICS. CHARGECODE: 6825. REALUSERCODE: ICS.
INITIATING MCS: SYSTEM/CANDE.
17:49:13 7074 MESSAGE: DISPLAY: .
17:49:13 7074 MESSAGE: DISPLAY:.
17:49:13 7074 MESSAGE: BAD PARAMETER VALUE FOR 'TAKE' FUNCTION @
(00000230)
17:49:13 7074 HISTORY: 002:0011:2 (00000230).
17:49:13 P-DS 7074 DBDATA/JOB.
USERCODE: ICS. CHARGECODE: 6825. REALUSERCODE: ICS.
STACK NUMBER: 03A0 AVERAGE MEMORY USAGE:
CODE=0, DATA=2041
PROCESSOR TIME: 00:00:00.1485 MEMORY INTEGRAL:
CODE=0.000, DATA=0.522
I/O TIME: 00:00:00.1072 INITIAL PBITS: 47.
READYQ TIME: 00:00:00.2462 MAXIMUM NUMBER OF ASD SUSED: 16.
INITPBIT TIME: 00:00:00.0137 MAXIMUM SAVE MEMORY USED: 1855.
ELAPSED TIME: 00:00:00.5385

Controlling the “Work Flow Statements” Listing

By default, the job summary is preceded by a section labeled “Work Flow Statements.”
This section lists the complete text of the WFL job, as well as the values of any
parameters passed to it.

If you don’t want the Work Flow Statements listing, you can suppress it by including the
compiler option $RESET LIST in the job.

Controlling Job Summary Printing


00000105 JOBSUMMARY = UNCONDITIONAL;

This statement in the WFL job requests printing of a job summary. The following are the
possible values for JOBSUMMARY:
• UNCONDITIONAL
Always print a job summary.
• CONDITIONAL
Print a job summary if a job or task terminates abnormally, or if there are syntax errors
or printer backup files.
• ABORTONLY
Print a job summary only if a job or a task terminates abnormally.
• SUPPRESSED
Never print a job summary.
• DEFAULT
Use system-level defaults to decide whether to print a job summary.

18–10 8807 7391-006


Debugging WFL Jobs and Tasks

Finding Abnormal Terminations


17:49:13 P-DS 7074 DBDATA/JOB.

A message indicating an abnormal termination.

The job summary typically contains entries recording the initiation and termination of the
WFL job and its tasks. The messages BOJ and EOJ indicate a normal “Beginning of Job”
and “End of Job.” The message BOT and EOT indicate normal “Beginning of Task” and
“End of Task.”

If the job or a task terminates abnormally, the EOJ or EOT message is replaced by a DS
message. There are a number of possible DS messages. For example, PDS and F-DS
indicate that the process committed an error of some kind. ODS indicates that an
operator issued a DS command. For a complete list of DS messages and their meanings,
refer to the Task Management Programming Guide

Finding Errors
17:49:13 7074 MESSAGE: BAD
PARAMETER VALUE FOR 'TAKE' FUNCTION @ (00000230)

An error message. If there is a DS message, you will usually find an error message right
before it. For information about error messages, refer to Using Job Messages earlier in
this section.

Finding Display Messages


17:49:13 7074 MESSAGE: DISPLAY: .

The first of several messages showing values displayed by the job. For an explanation of
the DISPLAY messages, refer to Adding DISPLAY Statements earlier in this section.

Requesting Program Dumps for Tasks


RUN OBJECT/DATA/FORMAT;
OPTION = (FAULT, DSED, ARRAYS, LIBRARIES);

Specifies a number of program dump options for a task. A program dump is a printout of
information about the task, including the values of variables and the structure of the
process stack.

Program dumps can help you to debug a task that terminated abnormally. However, to
understand a program dump, it helps to have some knowledge of the system architecture.
Contact your Unisys service representative for information about classes on reading
program dumps.

8807 7391-006 18–11


Debugging WFL Jobs and Tasks

If you have someone at your site who understands program dumps, then you should
probably set program dump options for most tasks you run. The effects of the options in
the example are as follows:
• FAULT
Causes a program dump if the task is terminated by an internal error.
• DSED
Causes a program dump if the task is terminated by operator DS or some other
problem external to the task.
• ARRAYS
If a dump occurs, includes the contents of any arrays used by the process.
• LIBRARIES
If a dump occurs, includes information about libraries used by the process.

This is a typical set of program dump options, but several others are available. For details,
refer to the description of the OPTION task attribute in the Task Attributes Programming
Reference Manual.

Creating Cross-Reference Files


The compiler control options $XREF and $XREFFILES can be used to generate cross-
reference information about the WFL job. $XREF generates a printer backup file while
$XREFFILES generates files usable by the Editor and other programming development
environments. See the WFL Programming Reference Manual for more information.

Example
00000100$SET XREF XREFFILES
00000200BEGIN JOB EXAMPLE;
00000300INTEGER VAR;
00000400
00000500SUBROUTINE SUB;
00000600BEGIN
00000700VAR := 10;
00000800END;
00000900
00001000VAR := 5;
00001100SUB;
00001200IF VAR = 10 THEN DISPLAY("GOOD");
00001300END JOB

Entering START FOR SYNTAX will create the files XREFFILES/OBJECT/<file title>/DECS
and XREFFILES/OBJECT/<file title>/REFS. These cross-reference files can be used in
Programmer’s Workbench, EDITOR and INTERACTIVEXREF to determine where VAR is
assigned and referenced and where the subroutine SUB is called.

18–12 8807 7391-006


Index

A -
abnormal terminations, messages indicating, - minus operator, 13–8
18–11 ampersand (&) string operator, 13–9
ABORT statement, 12–13 AND Boolean relation, 13–6
ABORTED task state, 13–5 ARCHIVESUPPORT system library and
ABORTONLY value, of JOBSUMMARY task LIBMAINTREPORTER errors, 7–32
attribute, 18–10 arithmetic operators, 13–8
ACCEPT function, 14–4 ARRAYS option, of OPTION task attribute,
18–12
AS statement, 8–2
: assignment statements, 13–2
:= character asterisk (*) character
assignment operator, 13–2 nonusercoded files, 15–1
string operator, 13–10
in multiplication, 13–8
’ asynchronous tasks, 5–17
’ character automatic display mode (ADM), 3–6
in FTP copies, 7–49 AUTOUNLOAD option of tape copies, 7–18
AX (Accept) system command, receiving
information from, 14–4

″ character
in FTP copies, 7–49 B
BAD VALUE FOR CASE EXPRESSION error,
12–5
; BADFILE system command, 7–38
; character, for separating statements, 4–3 BANNER print modifier, 9–5
Action field, in MARC, 3–4 BEGIN JOB prefix, 4–1
Active Entries display, 3–7 in ODT, 3–6
ACTIVE task state, 13–5 BEGIN...END statements, 12–1
actual parameter of a subroutine, 12–11 blanks, removing
ADD statement, 7–8 all, 13–12
and tape copies, 7–8 leading and trailing, 13–13
privileges for, 15–3 BLANKS value for FTP trimming, 7–50
addition, 13–8 BLIND value for FTP folding, 7–47
ADM (automatic display mode), 3–6 BLOCKSIZE file attribute for copy requests,
AFTER file attribute, 9–3 7–27
ALGOL parameter types, 5–20 BM option of PAGECOMP attribute, 9–4
ALL value, for FTP trimming, 7–51 BOJ message, 18–11
alternate family, in FAMILY statement, 5–7 Boolean expressions, 13–4
checking file attribute values, 13–6
checking task attribute values, 13–5
nesting, 13–7

8807 7391-006 Index–1


Index

parentheses, 13–7 client, FTP, 7–54


task state, 13–5 CLOSE value, for PRINTDISPOSITION, 9–3
comparing values, 13–6 COBOL74 parameter types, 5–20
complex, 13–7 COBOL85
Boolean relations compiler options in column 7, 10–3
AND, 13–6 formatting errors, 10–3
EQV, 13–6 parameter types, 5–20
IMP, 13–6 Command and Edit (CANDE)
NOT, 13–6 creating WFL jobs in, 3–2
OR, 13–6 starting the workfile, 3–2
Boolean variables, 13–2 submitting individual WFL statements,
BOT message, 18–11 3–1
buffer underrun, 7–11 page mode for creating WFL jobs, 3–2
by reference starting WFL jobs in, 3–2
subroutine parameters, 12–12 submitting multiple WFL statements, 3–2
task parameters, 5–21 tracking progress of WFL jobs, 3–3
by value subroutine parameters, 12–12 WFL prefix, 3–2
comments, adding to a job, 4–4
communicating with the operator, 14–1
C COMND screen, in MARC, 3–4
call by reference COMPARE option, of copy requests, 7–27
subroutine parameters, 12–12 comparing values, 13–6
task parameters, 5–21 COMPILE statement, 10–1
call by value subroutine parameters, 12–12 COMPILEDOK task state, 10–8, 13–5
CANDE, 3–1 compiler control options
capabilities of WFL, 2–1 ERRLIST, 10–4
C parameter types, 5–21 FREE, 10–3
card reader files, substituting data in COMPILE statement, 10–2
specifications, 5–4 LIST, 10–4, 18–10
CASE statement, 12–5 MERGE, 10–3
casing XREF, 10–5, 18–12
of WFL keywords, 4–3 XREFFILES, 10–5, 18–12
CC prefix compiling programs, 10–1
in ODT, 3–6 checking for success of compile, 10–8
CD Copies, 7–12 COBOL85 formatting, 10–3
CHANGE statement, 6–2 code file disposition, 10–2
families for multiple targets, 6–4 cross-reference information, 10–5
family substitution for, 6–3 error listings, 10–4
multiple targets, 6–3 executing object code file, 10–2
on a particular family, 6–3 free formatting COBOL85 programs, 10–3
privileges for, 15–3 object code file, 10–1
single files, 6–2 program listings, 10–4
using string expressions in, 6–5 saving object code file, 10–2
directories, 6–2 source code file, 10–1
FROM clause, 6–4 task and file equations, 10–7
CHANGE status, 15–3 choosing the compiler, 10–2
character sets in strings, 13–11 compiler control options, 10–2
CHARGEREQ usercode attribute for FTP patch files, 10–5
copies, 7–53 program listings, 10–4
CLASS job attribute, 11–5 Completed Entries display
other factors in queue selection, 11–6 checking for job completion, 3–8

Index–2 8807 7391-006


Index

and syntax errors, 3–7 FAMILYINDEX option, 7–29


COMPLETED task state, 13–5 from another usercode, 7–3
COMPLETEDOK task state, 13–5 from own usercode, 7–2
completion of tasks, checking for success, KIND default, 7–6
5–11 LIBRARY/MAINTENANCE, 7–9
COMPRESSIONCONTROL option, for tape monitoring progress, 7–10
copies, 7–18 multiple files, 7–2
COMPRESSIONREQUESTED option, for nonusercoded files on a family, 7–3
tape copies, 7–18 on a family, 7–3
CONDITIONAL value, of JOBSUMMARY renaming directories, 7–4
task attribute, 18–10 renaming files, 7–4
copy requests, 7–1 restarts, 7–42
checking for success, 7–31 single files, 7–2
job summaries, 7–32 status of copy request, 7–9
printing a report, 7–31 usercoded files on a family, 7–3
REPORT option, 7–31 using COPY as a command, 7–2
TASKVALUE task attribute, 7–31 waiting requests, handling, 7–35
COPY statement CPL option of PAGECOMP attribute, 9–4
privileges for, 15–3 creating WFL jobs in CANDE, 3–2
copying files, 7–14, 7–41 , 7–45
advanced features, 7–26
basics, 7–1 D
between hosts, 7–39 daily jobs, 11–7
accuracy, ensuring, 7–27 data, 13–1
combining separate copy requests, 7–5 Boolean expressions, 13–4
COMPARE option, 7–27 job parameters, 13–3
adding files to a destination, 7–8 numeric expressions, 13–8
defaults, 7–6 string expressions, 13–9
DSONERROR option, 7–29 variables, 13–1
efficiency, improving, 7–27 data compression, for tape copies, 7–18
error detection, 7–27 data specifications, 5–4
failures, determining cause, 7–32 replacing non-READER files, 5–4
FAMILY default, 7–7 replacing READER files, 5–4
HI command, 7–10 using multiple, 5–5
multiple destinations, 7–5 databases, querying or updating, 2–4
multiple sources, 7–4 debugging, 18–1
multiple sources and destinations, 7–5 data-dependent errors, 18–7
preserving files at destination, 7–8 delayed errors, 18–3
SINGLEUNIT option, 7–29 format of messages, 18–2
submitting COPY requests, 7–2 starting job for syntax checking only, 18–1
task attributes for copy request, 7–27 using DISPLAY statements, 18–8
usercode default, 7–6 using job messages, 18–5
using string expressions, 7–5 cascading errors, 18–2
VERIFY option, 7–27 COPY statements, 7–32
WAITONERROR option, 7–29 run-time errors, 18–5
block size, specifying, 7–27 syntax errors, 18–1
by date, 7–8 tasks with program dumps, 18–11
changing the usercode, 7–4 declarations
directories, 7–2 subroutines, 12–9
disk units, specifying, 7–29 task variables, 5–9
error handling, 7–29 default queue, 11–6

8807 7391-006 Index– 3


Index

DEFAULT value, of JOBSUMMARY task E


attribute, 18–10 editing WFL jobs in CANDE, 3–2
defaults Editor
for copy requests, 7–6 loading cross-reference files, 10–5
job parameter values, 13–4 loading error listings, 10–4
for variables, 13–2 for creating WFL jobs, 3–2
DENSITY option for tape copies, 7–18 ELSE clause
DEPENDENTSPECS file attribute, 6–8 null ELSE, 12–4
DIR (Directory) system command, printing in CASE statement, 12–5
tape directory disk files, 7–24 in IF statement, 12–3
DIRECT value, for PRINTDISPOSITION, 9–3 END JOB phrase, 4–1
directories, permanent, 6–1 END OF STATEMENT EXPECTED syntax
disk files error, 18–4
security, 15–1 EOJ message, 18–11
SECURITYTYPE, 15–1 EOJ value for PRINTDISPOSITION, 9–3
default usercode, 15–1 EOT message, 18–11
disk units, specifying in copy requests, 7–29 EOT value for PRINTDISPOSITION, 9–3
DISPLAY statements, 14–1 EQL
use in debugging, 18–8 numeric relation, 13–7
displaying messages to operators string relation, 13–7
FETCH specification, 14–2 equal sign (=), 13–7
INSTRUCTION statement, 14–2 EQV Boolean relation, 13–6
suppressing from ODT, 14–1 ERRLIST compiler control option, 10–4
DISPLAY statement, 14–1 ERROR 901 SYNTAX ERROR, 10–3
DISPLAYONLYTOMCS task attribute, 14–1 errors, 18–1
DIV numeric operator, 13–8 examples
division translate functions, 13–21
integer division, 13–8 EXECUTE status
real division, 13–8 and START statement, 15–3
remainder from integer division, 13–8 and RUN statement, 15–3
DL (Disk Location) system command, tape executing tasks, 5–1
directory disk files, 7–24 executing WFL jobs, 3–1
DO clause in WHILE statement, 12–7 from MARC, 3–4
DO statement, 12–8 from ODT, 3–6
Boolean expressions for, 13–4 in CANDE, 3–2
DOMAINNAME option, for FTP copies, 7–49, START statement options, 3–9
7–55 exiting a job early, 12–13
DONTPRINT value, for PRINTDISPOSITION, expandable library maintenance tapes, 7–25
9–3 expressions
DQ (Default Queue) system command, 11–6 Boolean, 13–4
DROP string expression, 13–11 string, 13–9
DS messages, 18–11 numeric, 13–8
DSED option, of OPTION task attribute,
18–12
DSONERROR option F
in copy requests, 7–29 family name, extracting from file title, 13–16
with wrap statement, 8–1 FAMILY task attribute, 5–7
DUMPALL and tape copies, 7–14 breaking into pieces, 13–18
CHANGE statements, 6–3
COPY statements, 7–7
primary family, 13–19

Index–4 8807 7391-006


Index

REMOTE statements, 6–5 MCP server to foreign host transfers,


secondary family, 13–20 7–50
target family, 13–19 preserving original record format, 7–48
FAMILYINDEX option in copy requests, 7–29 restoring after copy, 7–55
and SECTORS REQUIRED conditions, FILENAME file attribute, 6–8
7–36 files, 6–1
FAMILYINDEX <num>) SECTORS and family substitution, 6–5
REQUIRED ON <family>, 7–35 by file title, 6–6
FAMILYNAME file attribute, 6–8 by file variable, 6–6
fast access capability, checking for, 7–25 changing family, 6–4
FAULT option, of OPTION task attribute, controlling usage by a task, 5–2
18–12 copying, 7–1
F-DS message, 18–11 declaring, 6–7
FETCH specification, 14–2 directories, 6–2
file attributes, 6–7 families for multiple targets, 6–4
using string expressions, 13–9 family substitution for, 6–3
checking values, 13–6 managing, 6–1
lost during job restart, 17–1 multiple families, 6–6
file continuation number in PER MT display, multiple targets, 6–3
7–21 on a particular family, 6–3
file equations, 5–3 security restrictions, 15–1
in MODIFY statement, 10–8 single files, 6–5
in COMPILE statement, 10–7 using string expressions, 6–5, 6–6
file names waiting for, 6–7, 12–12
extracting from file titles, 13–18 directories, 6–5
FILENAME file attribute, 6–8 FAMILY statement, 5–7
file name> NOT ON <family name> copy multiple sets, 6–5
error, 7–33 opening, 6–8
file name> NOT ON <tape name> copy printing, 9–1
error, 7–33 reading or writing, 2–4
file number in PER MT display, 7–21 renaming, 6–2
file titles, 13–9 single files, 6–2
building with string expressions, 13–9 FILE/TRANSFER tasks, monitoring status,
parsing, 13–14 7–40
string operators for, 13–10 finishing a job early, 12–13
usercode, 13–15 flow of control, 12–1
using constants, 13–10 ABORT statement, 12–13
using strings, 13–10 GO TO statement, 12–6
breaking into pieces, 13–14 IF statements, 12–1
family name, 13–16 IF...ELSE, 12–3
file name, 13–18 nesting, 12–4
file transfer null ELSE, 12–4
requests, 7–39 simple IF, 12–2
services, 7–39 WAIT statement, 12–12
File Transfer Protocol (FTP), 7–39 WHILE statement, 12–7
FILEDATA utility, printing tape directory disk BEGIN...END statements, 12–1
files, 7–24 CASE statement, 12–5
FILEKIND file attribute DO statement, 12–8
input mapping for server, 7–54 STOP statement, 12–13
and default input mapping, 7–47 stringing, 12–3
restoring after copy, 7–55 subroutines, 12–9

8807 7391-006 Index– 5


Index

FOLDING option of FTP copies, 7–47 remote MCP server to local MCP server,
foreign host definition, 7–45 7–55
formal parameter of a subroutine, 12–11 restart problems, 7–56
FREE compiler control option, 10–3 USERCODE clause, 7–55
FROM clause FTPSITE option
in CHANGE statement, 6–4 controlling input mapping, 7–47
in REMOVE statement, 6–6 line breaks, 7–47
FROMSTART option, in NFT copies, 7–43 trimming output, 7–50
FTP clause, 7–53 defaults when omitted, 7–50
FTP copies, 7–45 in FTP copies, 7–55
account number, 7–49 RECORDLENGTH, 7–48
charge code, 7–53 FTRECOVERY files, removing, 7–44
directories, 7–46
disk family, 7–48
DOMAINNAME option, 7–49 G
file, 7–46 GEQ numeric relation, 13–7
FOLDING option, 7–47 GO disposition in COMPILE statement, 10–2
foreign to MCP server, 7–45 GO TO statement, 12–6
host, 7–49, 7–52 GTR numeric relation, 13–7
input mapping, 7–47, 7–54
line breaks, 7–47
local MCP server to remote MCP server, H
7–51 halt/load effect on WFL jobs, 17–1
MAPIN option, 7–47, 7–55 HEAD string expression, 13–11
MAPOUT option, 7–55 HEADER print modifier, 9–4
MCP server to foreign, 7–49 HI (Cause EXCEPTIONEVENT) system
multiple files, 7–46 command
password, 7–53 and simple WAIT statement, 14–3
preserving record format, 7–48 and TASKVALUE, 14–3
RECORDLENGTH option, 7–48 monitoring FILE/TRANSFER status, 7–40
remote file and family, 7–51 host, determining name of, 16–2
restoring FILEKIND, 7–55 Host Services File Transfer, 7–39
servers, 7–54 HOSTNAME
trimming output data, 7–50 task attribute, 16–2
usercode, 7–49, 7–53 NFT copy option, 7–41
USERCODE clause, 7–49, 7–53
clients, 7–54
DOMAINNAME option, 7–55 I
FILEKIND file attribute, 7–48 IB (Instruction Block) system command,
FTP clause, 7–53 14–2
FTP service, 7–39 ID value, for FTP trimming, 7–51
FTPSITE option, 7–55 IF statement, 12–1
IPADDRESS option, 7–49 Boolean expressions for, 13–4
local file, 7–46 IF...ELSE, 12–3
MAPOUT option, 7–53 stringing, 12–3
MAPOUT TRIM option, 7–50 nesting, 12–4
monitoring FILE/TRANSFER status, 7–40 null ELSE, 12–4
output mapping, 7–53 simple IF, 12–2
password, 7–49 IL (Ignore Label) system command
RECORDLENGTH option, 7–54 and tape copies, 7–15
IMP Boolean relation, 13–6

Index–6 8807 7391-006


Index

in assignment statements, 13–2 job attribute list, 11–1


INCLUDE option, 4–4 job name, 4–1
including statements from other jobs, 4–4 overall structure, 4–1
INITIALIZE statement, 5–10 subroutines, 12–9
initiating tasks, 5–1 using multiple statements, 4–2
initiating WFL jobs, 3–1 formatting and casing, 4–3
START statement, 3–9 job parameters, 13–3
input data, supplying for a program, 5–4 job summary, 18–9
input mapping in FTP copies, 7–47 for copy requests, 7–32
INSTRUCTION statement, displaying listing of WFL statements, 18–10
messages to operators, 14–2 JOBSUMMARY task attribute, 18–10
integer
converting to real, 13–8
converting to string, 13–21 K
expressions, 13–8 kind attribute for copying CDs
remainder from division, 13–8 examples, 7–13
division, 13–8 packet write recording, 7–11
variables, 13–2 restrictions, 7–13
INTEGER OVERFLOW error, real-to-integer track at once recording, 7–11
conversions, 13–8 KIND file attribute, 5–3
internal names of files used by tasks, 5–3 default in COPY statement, 7–6
INTNAME file attribute, 5–3
INUSE task state, 13–5
invoking tasks, 5–1 L
IPADDRESS option, for FTP copies labels and GO TO statements, 12–6
source host, 7–49 LANDSCAPE option of PAGECOMP
attribute, 9–4
leading characters, 13–11
J LENGTH string expression, 13–11
job attribute list, 11–1 LEQ numeric relation, 13–7
CLASS attribute, 11–5 LIBMAINTAPPEND option, for tape copies,
resource limits and queue selection, 11–6 7–25
selecting a job queue, 11–5 LIBMAINTDIR
STARTTIME assignment, 11–6 COPY statement option, 7–23
job name, 4–1 LIBMAINTREPORTER PROCEDURE NOT
in ADM display, 3–7 AVAILABLE... message, 7–32
job parameters, 13–3 libraries, invoking procedures in, 2–4
default values, 13–4 LIBRARIES option, of OPTION task attribute,
omitting optional parameters, 13–4 18–12
optional, 13–3 LIBRARY disposition in COMPILE statement,
using named parameters in START 10–2
statement, 13–4 LIBRARY GO disposition in COMPILE
in START statement, 13–4 statement, 10–2
job queue attributes, 11–2 library maintenance tapes, 7–14
job queues expanding, 7–25
default queue, 11–6 LIBRARY/MAINTENANCE, 7–9
example, 11–4 limitations of WFL, 2–4
job restarts, 17–1 LIST compiler control option, 10–4
job rollout, 17–1 in WFL, 18–10
job structure, 4–1 LM option of PAGECOMP attribute, 9–4
adding comments, 4–4 LOAD XREF command, in Editor, 10–5

8807 7391-006 Index– 7


Index

local hosts in copy requests, 7–39 messages, displaying to operator, 14–1


LOCALCOPY status and COPY statement, minus sign (-), 13–8
15–3 MIXLIMIT job queue attribute, 11–4
LOCKEDFILE option, for tape copies, 7–19 MOD numeric operator, 13–8
loops MODIFY statement, 10–8
DO statement, 12–8 MQ (Make or Modify Queues) system
repeating a fixed number of times, 12–8 command, 11–2
WHILE statement, 12–7 multiplication, 13–8
FOR statement, 12–8 multireel tape sets, 7–19
lowercase characters, 13–11 and tape directory disk files, 7–23
LPP option of PAGECOMP attribute, 9–4 Multivolume, 7–12
LSS numeric relation, 13–7 MYJOB task variable, 5–10

M N
MAPIN option in FTP copies name of WFL jobs, 4–1
foreign to MCP server, 7–47 named parameters, 13–4
remote MCP server to local MCP server, Native File Transfer (NFT), 7–39
7–55 negation
MAPOUT option, of FTP copies of numeric values, 13–8
remote MCP server to local MCP server of Boolean values, with NOT, 13–6
transfers, 7–55 NEQ
local MCP server to remote MCP server, numeric relation, 13–7
7–53 string relation, 13–7
MAPOUT option of FTP copies NEWFILE file attribute, 6–8
MCP server to foreign, 7–50 NFT copies
MARC, 3–4 deleting recovery files, 7–44
margins, in printing, 9–4 ensuring hosts are available, 7–42
MAXCARDS task attribute from beginning, 7–43
job queue selection, 11–6 FROMSTART option, 7–43
MAXIOTIME task attribute between remote hosts, 7–41
job queue selection, 11–6 between tapes on remote hosts, 7–42
MAXLINES task attribute from a remote host, 7–41
job queue selection, 11–6 from tapes on remote hosts, 7–41
MAXPROCTIME task attribute monitoring FILE/TRANSFER status, 7–40
job queue selection, 11–6 NFT service, 7–39
MAXWAIT task attribute to disk on a remote host, 7–41
job queue selection, 11–6 to tapes on remote hosts, 7–42
MCP server NO FILE <file name> MT condition, 7–36
definition, 7–45 NOFETCH system option, 14–2
Menu-Assisted Resource Control (MARC) NONE value
individual WFL statements, 3–4 FTP folding, 7–47
multiple WFL statements, 3–4 FTP trimming, 7–51
starting WFL jobs, 3–4 nonusercoded files, 15–1
TASKSTATUS screen, 3–5 NOT Boolean relation, 13–6
tracking progress of jobs, 3–5 NOT ON <family name> copy error, 7–33
using the Action field, 3–4 NOT ON <tape name> copy error, 7–33
using the COMND screen, 3–4 NOTE print modifier, 9–5
WFL prefix, 3–4 number sign (#), preceding string
MERGE compiler control option, 10–3 expressions, 13–10
Messages display, at ODT, 3–7

Index–8 8807 7391-006


Index

numeric expressions, 13–8 multiple WFL statements, 3–6


nesting, 13–9 starting WFL jobs, 3–6
parentheses, 13–9 tracking WFL jobs, 3–6
complex, 13–9 operators
numeric operators, 13–8 AX command, 14–4
numeric relations ACCEPT, 14–4
EQL, =, 13–7 displaying messages to, 14–1
GEQ, 13–7 FETCH statement, 14–2
GTR, >, 13–7 HI command, 14–3
LEQ, 13–7 INSTRUCTION statement, 14–2
LSS, <, 13–7 receiving information from, 14–3
NEQ, 13–7 simple WAIT, 14–3
numeric values, converting to strings, 13–21 SW1 through SW8, 14–4
DISPLAY statement, 14–1
HI command, 14–3
O TASKVALUE, 14–3
object code files, 10–1 optional parameters, 13–3
compiling, 10–1 omitting from START statement, 13–4
compiling in task and file equations, 10–7 OPTION task attribute, 18–11
adding task and file equations with OR Boolean relation, 13–6
MODIFY, 10–8
O-DS message, 18–11
ODT, 3–6 P
OK (Reactivate) system command, waiting Packet Write, 7–11
for, 12–12 packet write recording, 7–11
ON RESTART statement, 17–1 PAGECOMP file attribute, 9–4
ON string operator, 13–11 parallel tasks, 5–16, 5–17
OP (Options) system command explicitly waiting for, 5–19
NOFETCH system option, 14–2 initiating, 5–17
SERIALNUMBER option, 7–16 waiting for termination, 5–18
opening files, 6–8 PARAMETER MISMATCH error, 18–6
Operations Center parameters, 5–20
BEGIN JOB prefix, 3–8 parentheses
CC prefix, 3–8 in numeric expressions, 13–9
START statement, 3–8 in Boolean expressions, 13–7
submitting WFL jobs, 3–8 Pascal parameter types, 5–20
tracking WFL jobs, 3–8 patch files, compiling with programs, 10–5
views, 3–8 P-DS message, 18–11
operator display terminal (ODT) from ABORT statement, 12–13
automatic display mode (ADM), 3–6 PER MT system command for multireel tape
BEGIN JOB prefix, 3–6 sets, 7–21
CC prefix, 3–6 percent sign (, 4–4), use in comments, 4–4
CHANGE statement, 15–3 permanent directories, 6–1
ADD statement, 15–3 PG (Purge) system command
individual WFL statements, 3–6 and tape directory disk files, 7–24
preventing messages from displaying at, for assigning SCRATCHPOOL value, 7–17
14–1 for creating scratch tapes, 7–16
question mark (?) prefix, 3–6 for LOCKEDFILE tapes, 7–19
REMOVE statement, 15–3 plus sign (+), 13–8
START statement, 15–3 PORTRAIT option of PAGECOMP attribute,
COPY statement, 15–3 9–4

8807 7391-006 Index– 9


Index

primary family, in FAMILY statement, 5–7 question mark (?)


extracting, 13–19 prefix in ODT, 3–6
PRINTDEFAULTS task attribute, 9–2 queue attributes, 11–2
PRINTDISPOSITION file attribute, 9–3 QUEUE job attribute, 11–5
printing files, 9–1 quotation marks (″), 7–49
choosing a printer, 9–2
controlling when the request is created,
9–3 R
files and directories, 9–1 READ status and START statement, 15–3
header and trailer pages, 9–4 READER files, substituting data
setting print defaults, 9–2 specifications, 5–4
at a specified date and time, 9–3 reading from files, 2–4
at another host, 9–2 reading task attributes
banner pages, 9–5 of task variables, 5–9
margins, 9–4 various types, 5–9
page layout, 9–4 real
PAGECOMP file attribute, 9–4 converting to integer, 13–8
portrait and landscape, 9–4 converting to string, 13–21
PRINTDISPOSITION, 9–3 division, 13–8
PRIORITY job queue attribute, 11–4 expressions, 13–8
PRIORITY task attribute, 5–7 variables, 13–2
job queue selection, 11–6 RECOPY REQUIRED condition, 7–37
private files, 15–1 RECORDLENGTH clause, FTP copies, 7–54
PRIVATE security, for a disk file, 15–2 RECORDLENGTH option, for FTP copies,
procedures, 12–9 7–48
PROCESS statement, 5–17 recovery files, for NFT copies, 7–44
subroutines, 12–12 reel switches, 7–20
PROCESSTIME job queue attribute, 11–4 reference
program dumps, requesting, 18–11 subroutine parameters passed by, 12–12
programs task parameters passed by, 5–21
compiling, 10–1 REFERENCE keyword for task parameters,
running, 5–1 5–22
PU status remainder from integer division, 13–8
and CHANGE statement, 15–3 remote files, 5–5
and COPY statement, 15–3 remote hosts in copy requests, 7–39
and RUN statement, 15–3 REMOVE statement
and START statement, 15–3 and family substitution, 6–5
and REMOVE statement, 15–3 directories, 6–5
PUBLIC IN security, for a disk file, 15–2 multiple families, 6–6
PUBLIC IO security, for a disk file, 15–2 multiple sets, 6–5
PUBLIC SECURED security, for a disk file, REMOVE status, 15–3
15–2 single files, 6–5
PURGIT job using string expressions, 6–6
and LOCKEDFILE tapes, 7–19 privileges for, 15–3
and tape directory disk files, 7–25 removing blanks
all, 13–12
leading and trailing, 13–13
Q removing files
Q-DS message, 11–5 and family substitution, 6–5
querying databases, 2–4 directories, 6–5
multiple sets, 6–5

Index–10 8807 7391-006


Index

privileges for, 15–3 data-dependent errors, 18–7


using string expressions, 6–6 job messages reporting, 18–5
multiple families, 6–6
single files, 6–5
renaming files, 6–2 S
changing family, 6–4 SAVEMEMORYLIMIT task attribute, job
directories, 6–2 queue selection, 11–6
families for multiple targets, 6–4 Scheduled Entries display, at ODT, 3–7
family substitution for, 6–3 SCHEDULED task state, 13–5
multiple targets, 6–3 scheduling WFL job initiation
on a particular family, 6–3 weekdays, 11–7
single files, 6–2 daily, 11–7
using expressions, 6–5 STARTTIME job attribute, 11–6
repeating statements in loops scratch tapes and tape copies, 7–16
a fixed number of times, 12–8 SCRATCHPOOL option
DO statement, 12–8 in copy requests; REQUIRES MT
FOR statement, 12–8 conditions, 7–37
WHILE statement, 12–7 %, 7–17
REPORT option, in COPY requests, 7–31 SEARCHING FOR FILE message, 7–10
REQUIRES MT condition, 7–37 secondary family, extracting from family
RESIDENT expression statement, 13–20
by file title, 6–6 SECTORS REQUIRED ON <family> error,
waiting for, 6–7 7–35
by file variable, 6–6 SECURED security, for a disk file, 15–2
resource limits, 11–6 security, 15–1
RESOURCE task attribute, job queue default SECURITYTYPE, 15–1
selection, 11–6 default usercode, 15–1
RESTART (Restart Jobs) system command, disk files, 15–1
17–1 for CHANGE statement, 15–3
restarting jobs, 17–1 for COPY statement, 15–3
aborting on restart, 17–3 for REMOVE statement, 15–3
copy requests, 7–42 for RUN statement, 15–3
preventing task restarts, 5–2 for START statement, 15–3
retrying tasks nonusercoded files, 15–1
if operator approves, 5–13 privileges, 15–2
until successful, 5–12 SECURITY statement, 15–2
with validated operator approval, 5–15 SECURITY statement, 15–2
RETURN statement, 12–11 multiple files and directories, 15–2
reusing task variables, 5–10 SECURITY VIOLATION error for copy
RM option of PAGECOMP attribute, 9–4 requests, 7–34
rollout of a WFL job, 17–1 SECURITYTYPE file attribute, 15–1
RUN statement, 5–1 semicolon, for separating statements, 4–3
privileges for, 15–3 SEQUENCE value, for FTP trimming, 7–51
string expressions for parameters, 13–9 serial number
task equations, 5–6 for expandable tapes, 7–26
running and SERIALNUMBER system option,
tasks, 5–1 7–16
WFL jobs, 3–1, 3–9 selecting destination with, 7–17
run-time errors, 18–5 selecting source with, 7–15
debugging with DISPLAY statements, for expandable tapes, 7–26
18–8 omitting for destination, 7–16

8807 7391-006 Index– 11


Index

system, 16–2 STOPPED task state, 13–5


SERIALNUMBER system option, 7–16 STRING function, 13–21
server, FTP, 7–54 strings
sharing statements among multiple jobs, 4–4 all, 13–12
single quotation marks (″), 7–49 and character sets, 13–11
SINGLEUNIT option, in copy requests, 7–29 combining, 13–9
SECTORS REQUIRED conditions, 7–36 DROP function, 13–11
slash (/) EQL relation, 13–7
division operator, 13–8 expressions, 13–9
string operator, 13–11 HEAD function, 13–11
slash equals (/=) string operator, 13–11 in file titles, 13–10
SN (Serial Number) system command leading and trailing, 13–13
and tape directory disk files, 7–24 LENGTH function, 13–11
for assigning SCRATCHPOOL value, 7–17 replacing text within, 13–14
for assigning tape serial numbers, 7–21 TAIL function, 13–11
for creating scratch tapes, 7–16 TAKE function, 13–11
for LOCKEDFILE tapes, 7–19 TRANSLATE function, 13–11
SNTX message variables, 13–2
in Completed Entries display, 3–7 converting to numbers, 13–21
in CANDE, 18–2 determining length, 13–11
source code files, 10–1 expressions, 13–11
SOURCENAME task attribute and remote extracting leading characters, 13–11
files, 5–5 extracting trailing characters, 13–11
SPACE value, for FTP folding, 7–47 in CHANGE statement, 6–5
START statement in COPY statement, 7–5
privileges for, 15–3 in REMOVE statement, 6–6
starting a job every day, 11–7 LOWERCASE string expression, 13–11
starting a job immediately, 3–9 modifying, 13–11
STARTTIME assignment, 11–6 NEQ relation, 13–7
at ODT, 3–6 UPPERCASE string expression, 13–11
using parameters, 3–9 structure of WFL jobs, 4–1
in CANDE, 3–2 submitting WFL statements and jobs, 3–1
starting a job on weekdays, 11–7 subroutine parameters, 12–10
starting one WFL job from another, 3–10 by reference and by value, 12–12
SYNTAX clause, 3–10 types, 12–12
starting subroutines, 12–9
tasks, 5–1 waiting for tasks to terminate, 5–18
WFL jobs from CANDE, 3–2 initiating with PROCESS statement,
WFL jobs from MARC, 3–4 12–12
WFL jobs from ODT, 3–6 returning from early, 12–11
WFL jobs using START, 3–9 subtraction, 13–8
STARTTIME job attribute SUPPRESSED value, of JOBSUMMARY task
weekday runs, 11–7 attribute, 18–10
daily runs, 11–7 SW1 through SW8
format, 11–6 system commands, 14–4
in job attribute list, 11–6 task attributes, waiting for, 14–4
in START statement, 11–6 switches, waiting for, 14–4
statements, using multiple, 4–2 SYNTAX clause, in START statement, 3–10
STATIONNAME task attribute and remote debugging jobs, 18–1
files, 5–5 SYNTAX disposition, in COMPILE statement,
STOP statement, 12–13 10–2

Index–12 8807 7391-006


Index

syntax errors source serial number, 7–15


cascading errors, 18–2 source tape by name, 7–15
debugging, 18–1 tape directories, 7–22
format of messages, 18–2 tape directory disk files, 7–23
checking for with SYNTAX clause, 3–10 tape directories, 7–22
delayed, 18–3 tape directory disk files, 7–23
SYSTEM function multireel sets, 7–23
SERIALNUMBER, 16–2 printing contents, 7–24
HOSTNAME, 16–2 LIBMAINTDIR option, 7–23
system information location, 7–24
host name, 16–2 removal by SN or PG commands, 7–24
serial number, 16–2 TAPE FILE MISSING copy error, 7–35
SYSTEM/DUMPALL and tape copies, 7–14 tape name in PER MT display, 7–21
SYSTEM/FILEDATA utility, printing tape target family
directory disk files, 7–24 extracting from family statement, 13–19
SYSTEM/PATCH, 10–6 in FAMILY statement, 5–7
TASKVALUE task attribute, 10–7 task attributes
assigning to task variables, 5–9
in copy request, 7–27
T in job attribute list, 11–1
TAIL string expression, 13–11 lost during job restart, 17–1
TAKE string expression, 13–11 MYJOB task variable, 5–11
tape copies, 7–14 of a WFL job, 5–11
ADD statement, 7–8 PRIORITY, 5–7
adding files to an existing tape, 7–25 USERCODE, 5–6
automatic rewind and unload, 7–18 checking values, 13–5
compressing data, 7–18 definition, 5–6
destination, 7–16 reading various types, 5–9
ensuring unique serial numbers, 7–17 using string expressions, 13–9
fast access capability, 7–25 waiting for values, 5–20
from multireel sets, 7–22 task completion, checking for successful,
identifying tapes, 7–21 5–11
IL command, 7–15 task equations, 5–6
multiple sources to single tape, 7–18 contrasted with task variables, 5–8
omitting destination serial number, 7–16 in COMPILE statement, 10–7
omitting serial numbers, 7–20 in MODIFY statement, 10–8
requesting a DENSITY value, 7–18 TASK IS NOT PRIVILEGED TO COPY THIS
SCRATCHPOOL attribute, 7–17 DIRECTORY error, 7–35
SERIALNUMBER system option, 7–16 task parameters, 5–20
tape directories, 7–22 matching parameter types, 5–20
using serial numbers, 7–20 passing by reference, 5–21
compared to SYSTEM/DUMPALL, 7–14 changes made by task, 5–21
IL command, 7–15 task state expression, 5–11, 13–5
LIBMAINTAPPEND option, 7–25 task status, waiting for changes, 5–19
library maintenance tapes, 7–14 task termination, 5–11
locking the destination tape, 7–19 in subroutines, 5–18
multireel sets, 7–19 task variables, 5–8
pools of tapes, 7–17 MYJOB, 5–11
scratch tapes, 7–16 reusing, 5–10
serial number destination, 7–17 INITIALIZE statement, 5–10
source, 7–15 reading attributes of, 5–9

8807 7391-006 Index– 13


Index

TASKLIMIT task attribute, job queue U


selection, 11–6 UNCONDITIONAL value, of JOBSUMMARY
tasks task attribute, 18–10
and sequential, 5–18 UNIT HAS LOCATE FAST ACCESS
aborting job if task fails, 5–12 CAPABILITIES message, 7–25
checking for successful completion, 5–11 UNTIL clause in DO statement, 12–8
explicitly waiting for, 5–19 UNWRAP statement, 8–1, 8–4
file equations, 5–3 unwrapping directories of files, 8–4
initiating, 5–17 unwrapping files to a new disk, 8–5
and parallel, 5–18 unwrapping single files, 8–4
parallel, 5–16, 5–17 updating databases, 2–4
requesting program dumps, 18–11 uppercase
retrying, 5–12 using for keywords, 4–3
RUN statement, 5–1 uppercase characters, 13–11
running, 5–1 USEDEFAULTCHARGE usercode attribute
sequential, 5–16 for FTP copies, 7–53
termination, waiting for in subroutines, USERCODE clause, for FTP copies, 7–53,
5–18 7–55
waiting for termination, 5–18 USERCODE task attribute, 5–6
with validated operator approval, 5–15 effect on FAMILY default, 5–7
definition, 5–1 usercodes
file equations, 5–3 default for disk files, 15–1
flow of control, 5–16 extracting from file title, 13–15
if operator approves, 5–13 default in COPY statements, 7–6
parallel, 5–16
preventing restarts, 5–2
restarting after halt/load, 17–1 V
TASKVALUE task attribute variables, 13–1
for copy requests, 7–31 Boolean, 13–2
for SYSTEM/PATCH, 10–7 integer, 13–2
TDIR (Tape Directory) system command, real, 13–2
7–22 specifying initial values, 13–2
terminating a job early, 12–13 assigning values, 13–2
terminations of tasks, 5–11 combining multiple, 13–2
time interval, waiting for, 12–12 string, 13–2
TIMEDATE function, 16–1 task variables, 5–8
TITLE file attribute, 5–3 VERIFY option, of copy requests, 7–27
titles, 13–9
TM option of PAGECOMP attribute, 9–4
Track at Once, 7–11 W
track at once recording, 7–11
WAIT statement, 12–12
TRAILER print modifier, 9–4
for a length of time, 12–12
trailing characters, 13–11
for an OK, 12–12
TRIM option, 7–50
for file residence, 6–7
TRUNCATE value, for FTP folding, 7–47
for files, 12–12
truth conditions, 13–4
for HI (Cause EXCEPTIONEVENT) system
type, of the system, 16–3
command, 14–3
for task attribute values, 5–20
for task status changes, 5–19
waiting for parallel tasks, 5–19
for TASKVALUE, 14–3

Index–14 8807 7391-006


Index

waiting, 12–12 XREFFILES compiler control option, 10–5,


Waiting Entries display, at ODT, 3–8 18–12
WAITLIMIT task attribute
job queue selection, 11–6
WAITONERROR option, in copy requests, Special Characters
7–29 / character
weekdays, running jobs on, 11–7 in division, 13–8
WFL * character
capabilities, 2–1 in multiplication, 13–8
limitations, 2–4 nonusercoded files, 15–1
WFL jobs, definition, 2–1 string operator, 13–10
WFL prefix / character
in MARC, 3–4 string operator, 13–11
in CANDE, 3–2 # character, preceding string expressions,
WHILE statement, 12–7 13–10
Boolean expressions for, 13–4 /= characters
work flow management, 11–1 string operator, 13–11
workfile, in CANDE, starting, 3–2 = equals
WRAP statement, 8–1 numeric relation, 13–7
wrapped file security, 8–6 string relation, 13–7
wrapping + plus operator, 13–8
directories of files, 8–2 > greater than relation, 13–7
files into containers, 8–3 $INCLUDE option, 4–4
files to families, 8–2 < less than relation, 13–7
multiple files, 8–2 $LIST compiler control option
writing in WFL, 18–10
to files, 2–4 % character, use in comments, 4–4
task attributes in task equations, 5–6 ? character
in ODT, 3–6
& character, as a string operator, 13–9
X
XREF compiler control option, 10–5, 18–12

8807 7391-006 Index– 15


Index

Index–16 8807 7391-006


.
Copyright © 2017 Unisys Corporation.
All rights reserved. *88077391-006*
8807 7391-006

Вам также может понравиться