Align Record Layouts

Align Record Layouts. 1

Introduction. 1

Reordering Layouts. 1

Copy and Insert Command. 2

Introduction

If either (or both) of the copy books contain more than one layout we need to check that the layouts are correctly aligned.  For example, here we’re creating a spreadsheet with test copy books CaseI.jzc and CaseO.jzc.  After we have selected the input and output, Jazz displays this form: -

 

Since input layout CaseI corresponds to output layout CaseO, IN1 to IN1O, and LMRDRL to LMRDRLO, we simply click [Close] and move on.

Reordering Layouts

With copy books CaseIX/CaseO the layouts are out of sequence: -

 

Here we align the layouts by dragging one of the names up or down.

Copy, Delete, and Insert Commands

If you enter “C” in the C1 or C2 column the corresponding name is copied to the line below.  If the value below is not blank, then it will be copied to the line below, and if necessary another line will be added.  You would use this where the new data has been re-defined into several layouts.  For example, here the input file has a single layout, but the output file has 6 different layouts: -

 

Every cycle of the conversion program will read an input record with layout AMACRL, but depending on the $Case logic it will write out one of the 6 output types.  We need to set up a layout alignment that allows us to do this.

 

Enter “C” in the C1 column alongside AMACRL, and its value is copied into the next cell: -

 

Enter “I” and its value is copied down, leaving a blank.  Here we set up a condition in which we ignore the input record and write an initialised record with layout AMAC-NM-RECORD.

 

=>

 

Continue until we’ve dealt with all of the output layouts.  Since both “C” and “I” will create an extra line if necessary, we can create a situation like this if we want a final case to handle a situation in which we read an input record and write nothing: -

 

The spreadsheet will now be created with $Case logic to write one of the output records from AMACRL, or nothing if the last case is reached.  The conditional logic to choose a line is defined later.

Deleting Records

The command “D” deletes a record name from either the right or left hand side: -

 

=>

 

If we delete both input and output record names, then the record pair is omitted from the spreadsheet. 

 

If all record pairs except one is removed, then no case logic is needed, and the spreadsheet handles the remaining record pair as if this was the only record layout in the copy book. 

 

At least one name must remain in the input column, and one in the output column.  If you delete the last name from a column there is an error message, and you must click [Reset] to restore the form to the original list of input and output names. 

 

If you get into difficulty, you can click [Reset] at any time to start again.