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:

=COLS; ----+----1----+----2----+----
****** *****************************
000100 MAHENDER RAO 
000200 MAHENASR RSDDY 
000300 MAHENDER REDDY 
000400 MAHENASR REDDY 
000500 MAHENDER RGGDY 
000600 MAHENDER REDDY 
****** ****************************

Layout:

01 NAME. 
   03 FIRST-NAME PIC X(17).
   03 LAST-NAME PIC X(7).
   03 TITLE-1 PIC X(6).
   03 FILLER PIC X(90).

Refrmat Main screen:

File-AID ------------------ Reformat Definition ------------------------
OPTION === 

blank - Create a new or change an existing reformat definition 
D - Dynamically create and execute a temporary reformat definition 
E - Execute a previously saved reformat definition 

Specify Reformat Definition Dataset: 
Dataset name === 'TEST.FLD.MG9933.REFRMT' 
Member name === BBBB 
Volume serial === (If not cataloged) 
Description === 

Specify Execution Information: 
Process online or batch === O (O = Online; B = Batch) 
-------------------------------------------------------------------------

Specify Source and Target layout files:

-------------------------------------------------------------------------
Specify Source Record Layout and XREF Information: 
Record layout usage === S (S = Single; X = XREF) 
Record layout dataset ==='TEST.FLD.MG9933.SOURCE' 
Member name === SRCLO (Blank or pattern for member list)
XREF dataset name === 
Member name === (Blank or pattern for member list)

Specify Target Record Layout and XREF Information: 
Record layout usage ===S (S = Single; X = XREF) 
Record layout dataset === 'TEST.FLD.MG9933.SOURCE' 
Member name ===SRCLO1 (Blank or pattern for member list)
XREF dataset name === 
Member name === (Blank or pattern for member list)

Move corresponding? ===; YES (YES or NO) 

Ignore prefix === 
Ignore suffix === 
-------------------------------------------------------------------------

You will be directed to EDIT refrmat definition screen:

File-AID - Reformat Definition Editor - DS: 'TEST.FLD.MG9933.REFRMT(BBBB) - -
COMMAND === SCROLL === PAGE
Source COBOL - NAME -------------------- TEST.FLD.MG9933.SOURCE(SRCLO) -------
Num Field Name Format Pic OP Data Row 1 of 5
0 NAME GRP/120 
1 FIRST-NAME AN/17 
2 LAST-NAME AN/7 
3 TITLE-1 AN/6 
4 FILLER AN/90 
******************************* BOTTOM OF DATA *******************************



Target COBOL - NAME -------------------- TEST.FLD.MG9933.SOURCE(SRCLO1) ------
Num Field Name Format Pic Data Row 1 of 6
0 NAME GRP/120 
1 NAME-SFX AN/3 
2 FIRST-NAME AN/17 /FIRST-NAME 
3 LAST-NAME AN/7 /LAST-NAME 
4 TITLE-1 AN/6 /TITLE-1 
5 FILLER AN/87 
******************************* BOTTOM OF DATA *******************************

Edit the definitions

COMMAND === SCROLL === PAGE
Source COBOL - NAME -------------------- TEST.FLD.MG9933.SOURCE(SRCLO) -------
Num Field Name Format Pic OP Data Row 1 of 5
0 NAME GRP/120 
1 FIRST-NAME AN/17 
2 LAST-NAME AN/7 EQ 'REDDY' 
3 TITLE-1 AN/6 
4 FILLER AN/90 
******************************* BOTTOM OF DATA *******************************




Target COBOL - NAME -------------------- TEST.FLD.MG9933.SOURCE(SRCLO1) ------
Num Field Name Format Pic Data Row 1 of 6
0 NAME GRP/120 
1 NAME-SFX AN/3 'MR' 
2 FIRST-NAME AN/17 /FIRST-NAME 
3 LAST-NAME AN/7 /LAST-NAME 
4 TITLE-1 AN/6 'SIR' 
5 FILLER AN/87 
******************************* BOTTOM OF DATA *******************************

Come back and execute the definition:

File-AID ------------------ Reformat Definition ---------------------
OPTION ===> E 

blank - Create a new or change an existing reformat definition 
D - Dynamically create and execute a temporary reformat definition
E - Execute a previously saved reformat definition 

Specify Reformat Definition Dataset: 
Dataset name ===‘TEST.FLD.MG9933.REFRMT
Member name ===BBBB 
Volume serial ===(If not cataloged) 
Description === 

Specify Execution Information: 
Process online or batch === O (O = Online; B = Batch)

Output file looks like the below:

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

Add a Comment

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

Close Bitnami banner