Working With Business Views in Release 7.7.01 or Later

By Maria Volant

With Developer Studio Release 7.7.01, when opening a real Master File in Synonym Editor, clicking on the Business View button does not automatically generate a Business View file. Instead, a Business View pane is opened and the addition of Business View attributes updates the current Master File, turning the real Master File into a Business View.

To avoid changing the original Master File, the user could open the base Master File in the Synonym Editor tool, perform a “File,Save As” to create a copy of the Master File using the desired Business View name, and then add the desired Business View attributes, leaving the original Master File unchanged. Alternatively the user can also create a new synonym via Synonym Editor with the desired name for the Business View, insert the real Master File as a cross-reference file, and then add the Business Views attributes.

For example, if we open empdata.mas in Synonym Editor in Release 7.7.01 and click the Business Views button, the Business View pane shown in Screen 1 pops up and no Business View file in the form of empdata_bv01.mas is automatically generated. Business View attributes can be added in the Business View pane.

Screen 1

Also, if you look at the area inside the red circle on Screen 1 you will see that FOLDER1 is not created by default under ibisamp/empdata in the Business View pane. Instead, the user creates it manually. When folders are added in the Business View pane, they are no longer referenced using the SEGMENT key word in the Business View. Instead, the word FOLDER is used.

All Business View attributes added in the Business View pane are inserted at the end of the Master File being updated. Let’s say that we add a folder called EMPSEG in the Business View pane, add a few fields underneath it, and then close Synonym Editor and save changes. Now when opening empdata.mas the syntax would look like this:

FILENAME=empdata, SUFFIX=FOC     , $

  SEGMENT=EMPDATA, SEGTYPE=S1, $

    FIELDNAME=PIN, ALIAS=ID, USAGE=A9, FIELDTYPE=I, $

    FIELDNAME=LASTNAME, ALIAS=LN, USAGE=A15, $

    FIELDNAME=FIRSTNAME, ALIAS=FN, USAGE=A10, $

    FIELDNAME=MIDINITIAL, ALIAS=MI, USAGE=A1, $

    FIELDNAME=DIV, ALIAS=CDIV, USAGE=A4, $

    FIELDNAME=DEPT, ALIAS=CDEPT, USAGE=A20, $

    FIELDNAME=JOBCLASS, ALIAS=CJCLAS, USAGE=A8, $

    FIELDNAME=TITLE, ALIAS=CFUNC, USAGE=A20, $

    FIELDNAME=SALARY, ALIAS=CSAL, USAGE=D12.2M, $

    FIELDNAME=HIREDATE, ALIAS=HDAT, USAGE=YMD, $

    DEFINE AREA/A13=DECODE DIV (NE 'NORTH EASTERN' SE 'SOUTH EASTERN'              

CE 'CENTRAL' WE 'WESTERN' CORP 'CORPORATE' ELSE 'INVALID AREA'); $

  FOLDER=EMPSEG, $

    FIELDNAME=PIN, ALIAS=PIN, $

    FIELDNAME=LASTNAME, ALIAS=LASTNAME, $

    FIELDNAME=FIRSTNAME, ALIAS=FIRSTNAME, $

    FIELDNAME=MIDINITIAL, ALIAS=MIDINITIAL, $

    FIELDNAME=DEPT, ALIAS=DEPT, $

    FIELDNAME=SALARY, ALIAS=SALARY, $

    FIELDNAME=HIREDATE, ALIAS=HIREDATE, $

The steps performed would turn empdata.mas into a Business View. The Business View syntax (bold text) gets inserted at the end of the Master File. Again, to avoid updating empdata.mas, we can save the Business View under a different name using the “File,Save As” option before closing Synonym Editor.

To use empdata.mas as a base Master File for different Business Views, we can create a new Synonym via Synonym Editor. Let’s say we call it empdata_bv1, and then click on the Insert Reference button shown inside the red circle on Screen 2 to insert empdata.mas as a cross-reference.

Screen 2

Once empdata.mas is inserted as a cross-reference, you can open the Business View pane and add the desired Business View attributes as shown in Screen 3, for example.

Screen 3

The corresponding Business View syntax for empdata_bv1 based on the information shown on Screen 3 would look like this:

FILENAME=empdata_bv1, $

  SEGMENT=EMPDATA, CRFILE=IBISAMP/EMPDATA, CRINCLUDE=ALL, $

  FOLDER=EMPSEG, $

    FIELDNAME=LASTNAME, ALIAS=LASTNAME, $

    FIELDNAME=FIRSTNAME, ALIAS=FIRSTNAME, $

    FIELDNAME=DEPT, ALIAS=DEPT, $

    FIELDNAME=TITLE, ALIAS=TITLE, $

    FIELDNAME=SALARY, ALIAS=SALARY, $

In Release 7.7.0.1 (or new versions), when updating a Business View that references a base Master File using the old Business View syntax, the syntax would get updated to the new syntax. For example, consider the Business View below, which was originally created in Release 76.1.1:

FILENAME=EMPDATA_BV02, VIEW_OF=empdata, $

  SEGMENT=EMPSEG, $

    FIELDNAME=PIN, ALIAS=PIN, $

    FIELDNAME=LASTNAME, ALIAS=LASTNAME, $

    FIELDNAME=FIRSTNAME, ALIAS=FIRSTNAME, $

    FIELDNAME=MIDINITIAL, ALIAS=MIDINITIAL, $

    FIELDNAME=SALARY, ALIAS=SALARY, $

If we open empdata_bv02 in the 77.0.1 of Synonym Editor, add any change (e.g., add a Master File remark), and then close Synonym Editor and save changes, the syntax would now look like this:

FILENAME=empdata_bv02,

 REMARKS='Updated Business View', $

  SEGMENT=EMPDATA, CRFILE=empdata, CRINCLUDE=ALL, $

  FOLDER=EMPSEG, $

    FIELDNAME=PIN, ALIAS=PIN, $

    FIELDNAME=LASTNAME, ALIAS=LASTNAME, $

    FIELDNAME=FIRSTNAME, ALIAS=FIRSTNAME, $

    FIELDNAME=MIDINITIAL, ALIAS=MIDINITIAL, $

    FIELDNAME=SALARY, ALIAS=SALARY, $

Note that in the new syntax VIEW_OF=empdata from the old syntax is changed to CRFILE=empdata, CRINCLUDE=ALL and SEGMENT=EMPSEG is changed to FOLDER=EMPSEG.

The main thing to remember when working with Business Views in Release 7.7.01 or later is that if we don’t wish to change a real Master File into a Business View, we could save the real Master File with a different name and then add the Business View attributes. As an alternative, we could create a new synonym with the desired Business View name and insert the real Master File as a cross reference file so as to use the real Master File as a base file for the Business View being created.