Instructions on how to rename a field in Dataview/Table.
Release: DATABB00200-14-Datacom/AD
Things to remember:
1) A column/field has an entity name and a SQL name.
2) A field is part of an element(s), which is part of a table.
3) A Dataview is comprised of one or more elements.
Phase I:
Given the Datacom table name and the current field name, we can use DDOL:
Entity-type = FIELD
Parent-occurrence = table SLR-PLANT
Occurrence-name = LST-IVC-DT
Status = PROD
New Occurrence-name = PLT-INA-DT
PF9 to APPLY
This has renamed the field within the element within the table in Datadictionary.
Since the Dataviews in the Datadictionary are related to the same elements, the Dataviews in the Datadictionary have also been changed to reflect the new entity occurrence field name. However, because the element(s) was changed, each must be enabled in order to be used in Compile and Run by Ideal.
From DDOL:
Element name = SLR-PLMST
Table name = SLR-PLANT
STATUS = PROD
PF9 to APPLY
Phase II:
To find all of the Dataviews that pertain to this table with the new field name, we will need to run a DDUTILTY path report. The control cards may look something like this:
-USR myuserid,mypassword
-DEF PATH,WHATDVW
-DEF TRACE TABLE.ELEMENT,$INTERNAL,SKIP
-DEF TRACE ELEMENT.DATAVIEW,$INTERNAL
-END
-RPT START,TABLE,SLR-PLANT(PROD),WHATDVW
-RPT INDENT
-END
/*
The report will look like this:
-DEF PATH,WHATDVW
-DEF TRACE TABLE.ELEMENT,$INTERNAL,SKIP
-DEF TRACE ELEMENT.DATAVIEW,$INTERNAL
-END
Date: 06/28/2016 Time: 13.58.07 ******************************************
* CA Datacom Datadictionary
Security Level: 1 * Utility Report
* COPYRIGHT (C) 1990-2011 CA. ALL RIGHT
User: myuserid ******************************************
-RPT START,TABLE,SLR-PLANT(PROD),WHATDVW
-RPT INDENT
-END
Date: 06/28/2016 Time: 13.58.07 ******************************************
* CA Datacom Datadictionary
Security Level: 1 * Indented Report
* COPYRIGHT (C) 1990-2011 CA. ALL RIGHT
User: myuserid ******************************************
ENTITY-TYPE................... OCCURRENCE.....................................
DESCRIPTION.................................
SQLNAME..................................
TBL SLR-PLANT
SALES REPORT PLANT RECORD
CLARKE.SLR_PLANT
DVW SLSR-PLANT
DVW SLSU-PLANT
DVW SLSR-PLT
PLANT NAME & NBR-READ ONLY
DVW SLSU-PLT
PLANT NAME & NBR-UPDATABLE
DVW SLSR-PLT-NO-NM
SLS - SALES PLANT NO. AND NAME
DVW SLSR-PLT-NO-NM
SLS - SALES PLANT NO. AND NAME
***** END OF JOB - NO ERRORS *****
Phase III:
Modeled Dataviews are created within the Datadictionary, but also have to be populated into the Ideal catalogue. However, at this point only the Datadictionary Dataviews are aware of the field name change. Therefore, sign onto IDEA,
Dataview SLSU-PLT Version = PROD
Note: The first line of the display will reflect a new cataloged date and time. The new field name should be reflected as well.
Phase IV:
In Phase I, we only changed the Datacom entity occurrence name of the field. We now need to change the corresponding SQLNAME of the field for consistency. However, Datadictionary will not allow us to take such a short-cut as modifying the field that is in STATUS PROD, it can only be done in test status. Close all batch and online URTs for the DBID in question then issue the console command
F mymuf,COMM CLOSE dbid
Note: This will mean a temporary outage for the database and any applications referencing it.
From DDOL,
Database = SLR-SALES-RPT
To = T001
From = PROD
PF9 to APPLY
Entity-type = FIELD
Parent occurrence-name = SLR-PLANT
Occurrence-name = PLT-INA-DT
Status = T001
Tab down to the SQLNAME and overtype the previous value with PLT_INA_DT
PF9 to APPLY
Database = SLR-SALES-RPT
From status = T001
To status = PROD
PF9 to APPLY
Database = SLR-SALES-RPT
Status = PROD
Finally, open all batch and online URTs for the DBID.