File-AID Reformat Option

File-AID reformat option is very useful to copy one file to other by adding/modifying some data to it. It can be used to copy one file layout to other file layout by adding the additional data to the input file.
It can be used to copy all or selected records of any input file to an output file. While copying, you can (using file aid) reformat the records in the dataset based on matching the fields in two record layouts (source and target). Use this function when you need to add, change, or delete fields from the record(s) in any file, or to create a new file containing only a few fields (example, DB2 table loading).
File AID reformat is a copy process with much more powerful capabilities than a simple copy utility such as including:

  • Select only certain records to be processed.
  • The record data can be compared for certain value(s).
  • A field can be checked for a certain data type.
  • Initialize fields in the output file. For instance, add a new field to a file, initialize it while copying to the new file.
  • Reorganize fields in a file.
  • Define the new order of the fields for the file, copy the old file, reformatting fields, to the new file.
  • Validate fields in a file.
  • Copy input file, validating fields, dropping records with invalid fields from the new output file.

It handles files defined with a COBOL or PL/I Record Layout and these layouts are used to create a Reformat Definition for the input and output files.These Definition is used by File AID Reformat to specify input file selection criteria and output files field data values or source field references.Old unneeded Definitions can be deleted with the File-AID option 3.1 Library utility.

The input and output files may be of any type supported by File-AID. Following types are supported:

  • Physical Sequential Datasets.
  • Partitioned Datasets. (A single member only, not a whole PDS).
  • BDAM – Basic Direct Access Method.
  • VSAM – Virtual Sequential Access Method Datasets.
  • ESDS – Entry Sequenced Datasets.
  • KSDS – Key Sequenced Datasets.
  • RRDS – Relative Record Datasets.
  • IAM – Innovation Access Method(tm).

Example
1)
First Create s reformat PDS file with the following attributes:
Record Format: VB
Record Length: 80-32k
Blk Size:84-32k
Here no need to define reformat structure, it can be edited in file-aid itself.

2)
Create Input and output file layouts…

Ex: INPUT File & Layout:

Layout:

Refrmat Main screen:

Specify Source and Target layout files:

You will be directed to EDIT refrmat definition screen:

Edit the definitions

Come back and execute the definition:

Output file looks like the below:

*****************************
MR MAHENDER REDDY SIR
MR MAHENASR REDDY SIR
MR MAHENDER REDDY SIR

Leave a Reply

Your email address will not be published. Required fields are marked *

Bitnami