Chapter 15. Using File-AID/Batch
File-AID/Batch is a data manipulation program that consolidates the functions of many standard IBM utilities. Rather than learn JCL and the control syntax of several different utilities, you can use one tool, File-AID/Batch, to perform the following tasks:- Process data on tape or in very large, multi-volume disk files.
- Selectively edit, copy, reformat, total, compare, and print records contained in any standard MVS file type.
- Define a file processing task that may be run multiple times.
- Perform many functions of the following utilities: IEBGENER, IDCAMS (REPRO), IEBPTPCH, IEHMOVE, IEBCOPY, IEBISAM, IEBDG, IEHPROGM, IEBUPDTE.
- Generate DASD reports of VTOC information.
- Copy records or portions of records from one dataset type to another, including copying of PDS members based on ISPF statistics.
- Selectively print data records using record layouts, enabling you to tailor the format of the output to meet your specific data requirements.
- Change record format by reformatting any type of dataset (that is, enlarge data fields, add new data fields).
- Process datasets selectively to view or update information.
- Recognize logical JCL continuations for JCL changes and search conditions.
- Accumulate totals to verify reports.
- Read all VSAM and sequential datasets forward or backward.
- Reformat multiple record type files in one pass.
- Create a complete subset of related files for testing.
- Check control statement syntax online and execute actions in the foreground with File-AID's Interactive utility (option 3.8).
- Generate the JCL required to submit a File-AID/Batch job or any other non File-AID batch utility with File-AID's Batch Submit utility (option 3.9).
15.1 Specifying Your Batch Processing Request
File-AID/Batch actions are directed by a simple control language. Action requests consist of the following:- Dataset identification label
- Name of the function
- Set of optional selection, action, and control parameters.
Example Control Statement
$$DD01 COPY IN=100,IF=(1,EQ,C'A'),DUMP=0 COPY AND PRINT A RECS
Dataset Identifier | $$DD01 |
Function Name | COPY |
Selection, Action, and Control Parameters | IN=100,IF=(1,EQ,C'A'),DUMP=0 |
Comments | COPY AND PRINT A RECS |
Dataset Identifier
The first element on a File-AID/Batch control statement is the dataset identifier. This identifier connects an input dataset DD to a function that you want to perform. The dataset identifier begins in location 1 of the control statement as follows:$$DDxxwhere xx is a number from 01 to 99 that corresponds to a matching //DDxx DD JCL statement. The xx is also used to match the optional //DDxxO DD (output dataset) JCL statement.
Function Name
Functions identify the action you want to perform on the input dataset. Most functions can be abbreviated to save keystrokes. Some functions accept modifiers (ALL, MEM, BACK) that expand or modify the processing of a function.See the File-AID/Batch Reference Manual for a complete description of any of the following functions:
Function | Description |
---|---|
APRINT | Prints the audit trail file in formatted, character, or hexadecimal format. |
COMPARE | Compares the contents of two files. |
CONVERT | Converts existing File-AID Release 6.5 and below selection tables and Release 7 XREFs to File-AID's Release 8 new XREF format. Also converts Release 7 saved selection criteria to Release 8 selection criteria format. |
COPY | Copies data selectively or nonselectively. |
DROP | Eliminates unwanted records from a dataset while copying it. |
DUMP | Prints datasets in vertical hexadecimal format. |
FPRINT | Prints one or more records in formatted mode in a COBOL or PL/I record layout. |
LIST | Prints alphanumeric data. |
Prints alphanumeric data and labels each record with its record number and RBA. | |
REFORMAT | Reformats data as it is being copied. |
RLPRINT | Prints a COBOL or PL/I record layout displaying the field level, field name, format, field number, start location, end location, and field length. |
SCPRINT | Prints the dataset containing selection criteria created from File-AID online functions. |
SPACE | Moves the current record pointer through the input file. |
TALLY | Allows selection parameters to be combined with ACCUM parameters to provide audit-type totals for files. |
UPDATE | Alters records on a file. |
USER | Performs a copy function that provides greater control over the writing of output records and datasets. |
VTOCDSN | Displays VTOC summary information and dataset names in alphabetical sequence based on the specified parameters. |
VTOCINFO | Displays volume information based on the specified parameters. |
VTOCMAP | Displays volume information and datasets in address location sequence based on the specified parameters. |
XRPRINT | Prints record layout cross reference (XREF) dataset. |
Selection, Action, and Control Parameters
Parameters are code words that control or limit processing actions. Parameters define how to select and manipulate records. They are discussed in the Interactive utility online tutorial (press PF1 for HELP) and in the File-AID/Batch Reference Manual.Parameters are described below, grouped according to type.
Parameter Type | Description |
---|---|
SELECTION | Specifies the processing of records based on their contents. AND, IF, ORIF. |
ACTION | Indicates movement or change of data. ACCUM, EDIT, EDITALL, MOVE, REPL, REPLALL, WRITE. |
CONTROL | Defines basic environment conditions during execution. ABEND, CEM, CHARSET, DSN, ERRS, FEOV, FORM, IOEXIT, KEY, LAYOUT, LPI, MAP, MAXENT, MAXOUT, MEMBER, MEMBERS, NEWMEM, NEWMEMS, PADCHAR, PDSSTAT, RBA, RDW, REFOUT, RLM, RLPRINT, RRN, SHOW, TYPE, UNIT, VOLSER, VOLSTAT. |
LIMIT | Places record count limits on the datasets being processed. DROP, IN, OUT, SELECT, STOP. |
Provides a hardcopy report of records being processed. DUMP, LIST, FPRINT, PRINT. |
15.2 Executing the File-AID Batch Utility Interactively (Option 3.8)
File-AID/Batch utility can be executed in any of the following ways:- Code JCL and submit a job for background batch execution.
- Call from a program as a subroutine.
- Invoke the optional CLIST, FABATCH, to interactively execute at your TSO terminal.
- Use online File-AID, Interactive utility (option 3.8).
- Verifying the logic of a batch job before it is submitted.
- Performing functions and using logic not available through other utilities.
- Using most of the functions and parameters of File-AID/Batch (except USER).
- Entering control cards interactively.
- Viewing results and output at the terminal.
- Accessing File-AID/Batch online tutorials.
Step:
- From the File-AID Primary Option Menu (not shown here), select File-AID option 3.8 to access the Interactive Utility entry screen (Figure 15-1).
15.3 Defining Datasets to Process
The Interactive Utility entry screen (see Figure 15-1) captures your:- Input Dataset Name
- TO Dataset for Copy Functions
- Optional Control Dataset
- File-AID Run Options.
15.4 Performing the Totaling Function
The function TALLY is used to perform intelligent totalling of record fields. The ACCUM parameter specifies the location, description, type and size of each total to be reported. The ACCUM parameter is valid with most File-AID/Batch functions (for example, COPY, UPDATE, and PRINT) to provide the capability to report totals at the same time as performing other actions.Use the 3.8 Interactive utility to produce a report showing the total quantity of non-backordered inventory items in one of two warehouses in the inventory file.
Figure 15-1. 3.8 Interactive Utility. Running File-AID/Batch Online.
+--------------------------------------------------------------------------------+ | File-AID ------------------ Interactive Utility -----------------------------| | COMMAND ===> | | | | Input Dataset Information: | | Dataset name ===> FASAMP.INVFILE | | Volume serial ===> (If not cataloged) | | Password ===> (If password protected) | | | | "TO" Dataset Information for Copy Functions: | | Dataset name ===> | | Volume serial ===> (If not cataloged) | | Disposition ===> OLD (MOD or OLD) | | Password ===> (If password protected) | | | | Optional Control Dataset Information: | | Dataset name ===> | | Volume serial ===> (If not cataloged) | | | | File-AID Run Options: | | Allow File-AID prompting ===> Y (Y = Yes; N = No) | | Include record information ===> N (Y = Yes; N = No) | | Replace like named members ===> Y (Y = Yes, N = No) | | Use ENTER to begin interactive mode; END key to cancel function | | | +--------------------------------------------------------------------------------+
Steps:
- Type FASAMP.INVFILE in the Dataset name field.
- Press <Enter>. File-AID/Batch starts as a foreground task, and a Control Statement Entry screen is displayed (Figure 15-2).
More About the Interactive Utility Screen
- If you specified the name of a dataset in the "Dataset name" field in the "Optional Control Dataset Information" section, File-AID uses the control statements in the specified dataset to complete your request. The results of execution are immediately shown on the Control Statement screen. You are not prompted for control statements.
15.5 Entering Control Statements
To perform a function, type the control statement on the screen followed by ",GO" (comma GO) and press <Enter>. File-AID executes the statement and immediately displays any results on the screen. Enter the END command to exit.Because this is a foreground process, no tutorial information is available for the Control Statement screen. Also, ISPF facilities such as PF keys and scrolling are disabled.
As in ISPF, three asterisks (***) indicate additional information is awaiting display. Press <Enter> to display this information.
You selectively (IF) total (ACCUM) the quantity field in the sample inventory file ...FASAMP.INVFILE. You use the TALLY function to process the dataset. If the warehouse status (location 69) is equal to "AVAIL", total the quantity on hand (packed field at location 75).
Steps:
- Type the control statement:
TALLY IF=(69,EQ,C'AVAIL'),ACCUM=(75,'QTY AVAIL WH-1'),GO
- Press <Enter>. File-AID reads the records of the input dataset, tests each record for the condition specified in the control statement, and displays the results as shown in Figure 15-3.
Figure 15-2. Interactive Utility. Requesting a TALLY on the Foreground Control Statements Screen.
+--------------------------------------------------------------------------------+ | F I L E - A I D V8.0.1 RELEASE DATE 10/21/96 | | ....ENTER NEXT FUNCTION OR END | |TALLY IF=(69,EQ,C'AVAIL'),ACCUM=(75,'QTY AVAIL WH-1'),GO | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +--------------------------------------------------------------------------------+
More About Control Statement Entry
- Notice that the dataset identifier $$DD01 portion of the control statement is not required with the Interactive utility.
- If you use the optional Control Statement Dataset to supply control statements to the Interactive utility, the dataset identifier must be specified as $$DD01.
- For non-packed data, use the ACCUM syntax:
ACCUM=(location,length,data-type,description)
Valid data-types are C for display numeric (maximum length 15) and B for binary (maximum length 4). Type BS is also provided to indicate binary signed data for lengths 1, 2, and 3.
- When processing a variable length sequential file in File-AID/Batch, location 1 references the 4-byte record descriptor word (RDW). Location 5 references the first byte of data in the record. Use the parameter RDW=3 to bypass the RDW and have location 1 reference the first byte of data. In this example, you notice that the RDW parameter is not used. The locations are four (4) bytes larger than the offset of the STATUS and QUANTITY fields shown when using formatted browse to view this file with a record layout (see Figure 13-4).
- Use the PA1 or ATTN keys to abort processing of your request.
Exiting Interactive Execution
Results of your request are displayed immediately at your terminal as shown in Figure 15-3.When the ...ENTER NEXT FUNCTION OR END prompt is displayed, you may specify another function to act on the same file, or enter the END command to exit and return to the Interactive Utility screen.
Steps:
- Type END.
- Press <Enter>. The three asterisk (***) prompt is displayed. Press <Enter> again to display the Interactive Utility screen (Figure 15-1). Note the message, FUNCTION COMPLETED, in the top right corner of the screen.
Figure 15-3. Foreground Control Statements Screen - TALLY Results
+--------------------------------------------------------------------------------+ | F I L E - A I D V8.0.1 RELEASE DATE 10/21/96 | | ....ENTER NEXT FUNCTION OR END | |TALLY IF=(69,EQ,C'AVAIL'),ACCUM=(75,'QTY AVAIL WH-1'),GO | | SYS00009 DSN=USERID9.FASAMP.INVFILE OPENED AS PS, | | RECFM=VB,LRECL=517,BLKSIZE=5170,VOL=PRD900 | | ABOVE FUNCTION ENDED ON NORMAL EOD | | RECORDS/READ-41 | | | | QTY AVAIL WH-1----------------------14512 | | | | ....ENTER NEXT FUNCTION OR END | | | | | | | | | | | | | | | | | | | | | | | | | +--------------------------------------------------------------------------------+
15.6 Submitting File-AID/Batch JCL
JCL for File-AID/Batch is very simple to specify. After you have created the JCL once, you can use the same JCL as a model for subsequent runs just by changing control statements and dataset names.You can use one of the many File-AID functions which support batch submit to generate File-AID/Batch JCL including:
- 3.3 Copy
- 3.6 Search/Update
- 5.x Print
- 9 Reformat
- 10 Compare
- BATVTOC - Batch VTOC examples
- COPY - Sample selective COPY
- DROP - Sample DROP function of dropping bad records
- DUMP - Sample hex report of 5 records
- JCLCNVRT - Sample USER function to insert a SYSUDUMP DD in JCL
- LIST - Sample print of JCL member of PDS
- PRINT - Sample print of variable file
- SKELETON - Sample of all possible File-AID/Batch JCL statements
- SPACE - Sample SPACE function to skip to desired record
- TALLY - Sample TALLY function on INVFILE
- UPDATE - Sample UPDATE conditional logic IF-REPL
- USER - Sample USER function to create 3 files from 1 input file
15.7 Examples of Customer Uses of File-AID/Batch
This section describes a few of examples of the many uses for File-AID/Batch.If you do not specify any control statements (SYSIN DD DUMMY), File-AID/Batch automatically copies all records in DD01 to DD01O. Notice how quickly that File-AID performs a VSAM copy.
Applying Mass Changes to a JCL Library
File-AID lets you make mass changes to a JCL library in batch and online modes.You need to update the JCL for 15,000 jobs because you upgraded from 3350 to 3380 disk drives. You want to change the UNIT and SPACE parameters to avoid overallocation with the larger disk drives.
//JOBNAME JOB (REST OF JOB CARD) //STEP1 EXEC PGM=FILEAID //STEPLIB DD (REQUIRED ONLY IF FILEAID IS NOT ON THE LINK LIST) //SYSPRINT DD SYSOUT=* //DD01 DD DSN=OLD.JCL.LIB,DISP=OLD //DD01O DD DSN=NEW.JCL.LIB,DISP=OLD //SYSIN DD * $$DD01 COPYALL MEMBERS=ALL,FORM=JCL, CONTROL PARAMETERS COMMENT EDIT=(3,0,C'UNIT=DISK,UNIT=SYSDA,UNIT=3350',C'UNIT=3380'), REPL=(3,0,C'SPACE=(CYL',C'SPACE=(TRK')The following JCL considerations apply to this example:
- A SYSPRINT DD statement is used for all hardcopy output, control card analysis, and log of actions taken.
- Statement DD01 defines the input dataset.
- Statement DD01O defines the output dataset.
- SYSIN DD statement specifies control statements.
- Control statements use the $$DD01 dataset identifier to identify the file(s) to be acted on (DD01 and DD01O).
- The COPYALL function directs File-AID/Batch to copy all records from the input file (DD01) to the output file (DD01O).
- The MEMBERS=ALL parameter directs File-AID/Batch to include all input PDS members.
- The FORM=JCL parameter tells File-AID/Batch that the data being processed is JCL. File-AID/Batch interprets JOB, EXEC, and DD statements and handles continuations and syntax correctly.
- The EDIT parameter directs a search of each JCL statement beginning in
position 3 (after the //). It searches all characters until the end of the JCL
statement is found (length 0) and looks for any of the three strings:
- UNIT=DISK
- UNIT=SYSDA
- UNIT=3350
- The REPL (replace) parameter is also applied to each JCL statement as it is copied. The REPL parameter tells File-AID/Batch to search for the string SPACE=(CYL, then change the string to SPACE=(TRK. When changing JCL, the EDIT parameter is preferred over the REPL parameter unless the data that is searched for and the replacement data are the same length.
Copying From One Input File to Create Multiple Output Files
A large company collects file selection requests through the week and creates File-AID/Batch control cards on the weekend. This example illustrates how you can make a single pass through a master file (in this case 34 reels of tape) to create two extract output files that contain different subsets of data.File-AID/Batch lets you create up to 99 output files. While the COPY function copies records to a single target file, the USER function can copy records to multiple target files. Use the WRITE parameter with the USER function to indicate the DDNAME to which you want to write a record.
//STEP1 EXEC PGM=FILEAID //STEPLIB DD (REQUIRED ONLY IF FILEAID IS NOT ON THE LINK LIST) //SYSPRINT DD SYSOUT=* //DD01 DD DSN=MASTER.FILE.REELS34,DISP=OLD //SELECT1 DD DSN=SELECT1.FILE,DISP=OLD //SELECT2 DD DSN=SELECT2.FILE,DISP=OLD //SYSIN DD * $$DD01 USER IF=(27,EQ,X'15'), WRITE=SELECT1, IF=(14,EQ,C'20,21,22'), IF 14 EQUAL 20 OR 21 OR 22, WRITE=SELECT2
Scanning and Printing Data in a Load Library
XYZ Corporation changed its name. The following control statement determines which programs must be changed to reflect the new company name.$$DD01 PRINT IF=(1,0,C'XYZ CORP'),MOVE=(1,9,+0)File-AID scans the production load library for XYZ CORP. Because a MOVE parameter is used with a PRINT function, File-AID interprets PRINT as a request to print only the data that is moved, regardless of the length of the input record. Therefore, only the member name and XYZ CORP are printed. Code PARM=TSO on the EXEC statement to eliminate needless page skipping for each member.
Note: File-AID can also update load module libraries with the UPDATE function and the REPL parameter.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.