55
EDA Replication and the EDA Schema Manager User Guide Version DEC2015 December 2015 DBT-DEC2015–EDAR-DG-01

Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

EDA Replication and the EDASchema Manager

User Guide

Version DEC2015

December 2015DBT-DEC2015–EDAR-DG-01

Page 2: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

2

NoticesEdition

Publication date: December 2015Book number: DBT-DEC2015–EDAR-DG-01Product version: Version DEC2015

Copyright© Rocket Software, Inc. or its affiliates 1989-2015. All Rights Reserved.

Trademarks

Rocket is a registered trademark of Rocket Software, Inc. For a list of Rocket registered trademarks goto: www.rocketsoftware.com/about/legal. All other products or services mentioned in this documentmay be covered by the trademarks, service marks, or product names of their respective owners.

Examples

This information might contain examples of data and reports. The examples include the names ofindividuals, companies, brands, and products. All of these names are fictitious and any similarity tothe names and addresses used by an actual business enterprise is entirely coincidental.

License agreement

This software and the associated documentation are proprietary and confidential to Rocket Software,Inc. or its affiliates, are furnished under license, and may be used and copied only in accordance withthe terms of such license.

Note: This product may contain encryption technology. Many countries prohibit or restrict theuse, import, or export of encryption technologies, and current use, import, and export regulationsshould be followed when exporting this product.

Page 3: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

3

Corporate informationRocket Software, Inc. develops enterprise infrastructure products in four key areas: storage, networks,and compliance; database servers and tools; business information and analytics; and applicationdevelopment, integration, and modernization.

Website: www.rocketsoftware.com

Rocket Global Headquarters77 4th Avenue, Suite 100Waltham, MA 02451-1468USA

To contact Rocket Software by telephone for any reason, including obtaining pre-sales informationand technical support, use one of the following telephone numbers.

Country Toll-free telephone number

United States 1-855-577-4323Australia 1-800-823-405Belgium 0800-266-65Canada 1-855-577-4323China 800-720-1170France 08-05-08-05-62Germany 0800-180-0882Italy 800-878-295Japan 0800-170-5464Netherlands 0-800-022-2961New Zealand 0800-003210South Africa 0-800-980-818United Kingdom 0800-520-0439

Contacting Technical Support

The Rocket Customer Portal is the primary method of obtaining support. If you have currentsupport and maintenance agreements with Rocket Software, you can access the Rocket CustomerPortal and report a problem, download an update, or find answers to in the U2 Knowledgebase.To log in to the Rocket Customer Portal or to request a Rocket Customer Portal account, go towww.rocketsoftware.com/support.

In addition to using the Rocket Customer Portal to obtain support, you can send an email [email protected] or use one of the following telephone numbers.

Country Telephone number

North America +1 800 729 3553United Kingdom/France +44 (0) 800 773 771 or +44 (0) 20 8867 3691Europe/Africa +44 (0) 20 8867 3692Australia +1 800 707 703 or +61 (0) 29412 5450New Zealand +0800 505 515

Page 4: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

4

Contents

Notices................................................................................................................................................................................... 2

Corporate information......................................................................................................................................................... 3

Chapter 1: EDA Replication overview..................................................................................................................................6

Chapter 2: Getting started................................................................................................................................................... 7Starting the EDA Replication Config tool................................................................................................................7Establishing server connections.............................................................................................................................. 7

U2 server definitions.................................................................................................................................... 7Creating U2 server definitions..................................................................................................................... 7

Viewing or editing advanced settings of a U2 server definition............................................................................ 8Specifying a command to run on connection............................................................................................ 9

Setting up SSL settings for a U2 server definition................................................................................................. 9Editing U2 server definitions..................................................................................................................................10Importing an existing U2 server definition........................................................................................................... 10Connecting to U2 servers.......................................................................................................................................11Disconnecting from U2 servers..............................................................................................................................11Deleting U2 server definitions............................................................................................................................... 11Installing and updating the DBTools using the Eclipse Update Manager...........................................................12XTOOLSUB............................................................................................................................................................... 12

Installing XTOOLSUB for UniData on Windows........................................................................................ 13Installing XTOOLSUB for UniVerse on Windows....................................................................................... 14Installing XTOOLSUB for UNIX/Linux for UniData.................................................................................... 14Installing XTOOLSUB for UNIX/Linux on UniVerse....................................................................................15Installing XTOOLSUB on Windows............................................................................................................ 16

Chapter 3: Managing EDA Replication.............................................................................................................................. 17Defining EDA Replication parameters................................................................................................................... 17Configuring the Replication system...................................................................................................................... 18Choosing files to replicate..................................................................................................................................... 20Defining a data source........................................................................................................................................... 21Defining an EDA data source connection............................................................................................................. 21Synchronizing replication files.............................................................................................................................. 22Creating default EDA schemas for the replicated files.........................................................................................22Creating EDA schemas for selected attributes..................................................................................................... 22Converting U2 files to EDA files............................................................................................................................. 22

Chapter 4: The EDA Schema Manager...............................................................................................................................24The EDA Schema Manager steps........................................................................................................................... 24The EDA Schema Manager..................................................................................................................................... 24

Create a new UniData or UniVerse server connection............................................................................. 25Connecting to the UniData or UniVerse server.........................................................................................26

Managing connections........................................................................................................................................... 27About data sources.....................................................................................................................................27

Connecting to SQL Server, Oracle, or the IBM database............................................................. 27Connecting to Microsoft SQL Server using the Native Client.......................................................28

Defining a data source........................................................................................................................................... 29Selecting EDA schema files.................................................................................................................................... 32

Selectively mapping attributes..................................................................................................................34Attribute details.............................................................................................................................. 36

View EDA server details..............................................................................................................................38View UniData or UniVerse server details...................................................................................................38View options................................................................................................................................................39

Whole record...................................................................................................................................39

Page 5: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Contents

5

Unmapped field block (KB)............................................................................................................40Nonconforming record................................................................................................................... 40Table space..................................................................................................................................... 40View field details.............................................................................................................................41Scalar function example................................................................................................................ 42TRANS example...............................................................................................................................43Table function example................................................................................................................. 45

Verifying the EDA schema...................................................................................................................................... 48Viewing the EDA schema........................................................................................................................................49Changing the schemas........................................................................................................................................... 50Viewing the DDL scripts..........................................................................................................................................51Converting data...................................................................................................................................................... 51

Viewing EDA files.........................................................................................................................................52Listing and selecting data......................................................................................................................................52

Listing data using RetrieVe........................................................................................................................ 52Listing data using UniData or UniVerse SQL............................................................................................ 53

Appendix A: Working with U2 virtual fields against SQL Server 2008............................................................................. 54

Page 6: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

6

Chapter 1: EDA Replication overviewEDA Replication is useful if you want to maintain an account from which you can create reports.You can replicate your data to an SQL database in addition to keeping your data safely store in thedatabase. When you store your data in UniData or UniVerse, it is simultaneously replicated to Oracle,IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while youuse UniData or UniVerse as your production workhorse.

To manage EDA Replication, use the EDA Replication Config tool. This tool enables you to edit EDAmap schemas, edit data source definitions, and convert UniData or UniVerse files to EDA files.

Page 7: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

7

Chapter 2: Getting started

Starting the EDA Replication Config toolBefore you can manage EDA Replication, you must start the EDA Replication Config tool.

The EDA Replication tool must be running on a Microsoft Windows computer that is on the samenetwork as the server computer running UniData or UniVerse.

Make sure that UniData or UniVerse services are currently running on the server computer with EDAenabled.

On the taskbar of the Windows computer on which the EDA Replication Config tool is installed, chooseStart > All Programs > Rocket U2 > EDA Replication Config Tool

Establishing server connections

U2 server definitions

The U2 DBTools interface does not detect the presence of UniData or UniVerse (U2) database serverson the network or let you connect to them by default. To work with UniData or UniVerse accounts anddata, you must enable the computer to connect to the server on which the accounts and data reside.The client computer requires a U2 server definition to make a connection with the server.

A U2 server definition is stored on the client computer on which it was created, and is not sharedacross a network. One or several users can create multiple U2 server definitions on the same clientcomputer.

U2 server is the term for a defined connection to a server computer on which U2 accounts and dataare stored. All existing U2 servers on the client computer are listed in the U2 Resource view. You canconnect to any U2 server in the U2 Resource list.

Creating U2 server definitions

To administer UniData or UniVerse accounts and data, you must create a U2 server definition thatenables the client computer to connect to the U2 database server on which the accounts and data arestored.

Prerequisites

Open the U2 DBTools workspace from the Start → Rocket U2 menu.

Procedure

1. To start the Create a New U2 Server wizard, right-click the U2 Servers node in the U2 Resourceview, and click New U2 Server.

2. In the Name field, enter a unique name to identify the U2 server definition.The name cannot contain a slash (/) or backslash (\) character.

Page 8: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 2: Getting started

8

3. In the Host field, enter the name or IP address of the computer on which UniData or UniVerse isrunning.

4. From the U2 database server options, select UniData or UniVerse.5. Optional: To view or edit the unirpc service name, port number, and other advanced settings

defining the connection, click Advanced.

Go to Viewing or editing advanced settings of a U2 server definition, on page 8.

Tip: The default values for advanced settings work best in most situations. Alter thesesettings only if necessary.

6. Optional: To view or update the SSL settings, click Setup SSL.

Go to Setting up SSL settings for a U2 server definition, on page 97. To save the U2 server definition, click Finish.

The tool creates a directory for the U2 server, registering the server definition so the tool can findit in future sessions. The name of the new U2 server is added to the list in the U2 Resource view.

Next step

Connecting to U2 servers, on page 11

Viewing or editing advanced settings of a U2 serverdefinition

On the advanced settings page of the server definition, you can view or edit the protocol, port number,and other advanced settings that define the connection. You can also specify commands to run whenyou connect to the U2 server. The default values for advanced settings work best in most situations.Alter these settings only if necessary.

Prerequisites

Creating U2 server definitions, on page 7 or Editing U2 server definitions, on page 10

Procedure

1. The Protocol Type field displays TCP/IP as the communications protocol used by the UniData orUniVerse to access the internet.At this time, the only supported protocol is TCP/IP, and this setting cannot be changed.

2. In the RPC Port # field, enter the port number of the UniRPC server running on the host.The default port number is 31438.

3. In the RPC Service Name field, enter the name of the remote procedure call (RPC) service on thesystem.For UniData, the name is normally udcs; for UniVerse, the name is normally uvcs.

4. In the Login Account field, enter the full path to the account folder on the server running UniDataor UniVerse.You can enter just the account name if the account is defined in the UD.ACCOUNT or UV.ACCOUNThash file.

5. If you run a RetrieVe command, a saved paragraph, or a globally cataloged program every timeyou connect to the U2 server, you can save time by entering the command in the U2 server

Page 9: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Specifying a command to run on connection

9

definition. To enter a command to run on connection, click Add in the Commands to Executegroup box.See Specifying a command to run on connection, on page 9.

6. In the Specify the session to run/debug your BASIC program on server side group box, enterdetails for connecting to the server in a debug session.a. From the Protocol options, select the network protocol to use when you connect to the U2

server in a debug session: Telnet or SSH (Secure Shell).b. In the Port Number field, enter the port number on which the Telnet or SSH service runs on

the server computer. The default Telnet port number is 23; the default SSH port number is22.

c. If device licensing is supported on the server, select the Use Device License check box toconserve license usage in the debug session.

While running or debugging BASIC programs, you may use multiple server connections to browsefiles, check data, update records, or perform other tasks. If device licensing is disabled, the debugsession consumes one U2 license for each connection. With device licensing enabled, the sessionconsumes one U2 license and one device license for up to 10 connections from a single device.

Tip: If you are unable to establish a Telnet or SSH connection with the Use Device Licensecheck box selected, clear the check box and try again.

7. To save changes to advanced settings and return to the main page, click Finish.

Specifying a command to run on connection

You can run a RetrieVe command, a saved paragraph, or a globally cataloged program every timeyou connect to the U2 server. Rather than type the same command each time you connect, you canincrease efficiency and save time by entering the command in the U2 server definition.

1. In the Specify a command field, enter a RetrieVe command, the name of a saved paragraph, orthe name of a globally cataloged program to run when you connect to the U2 server.

2. To save the changes and return to the details page, click OK.

Setting up SSL settings for a U2 server definitionOn the Database Connection Security page for the server definition, you can turn on SSL, and add atrust store and trust store password for the connection.

Prerequisites

Creating U2 server definitions, on page 7 or Editing U2 server definitions, on page 10

Procedure

1. Select the Use SSL checkbox to enable SSL.

Note: The key store must be an absolute file.

2. Select Use Default Trust Store to enable the trust store.3. Enter the location of the trust store you want to use, or click Browse to navigate the correct

location.

Page 10: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 2: Getting started

10

4. Enter the trust store password.5. To save changes to the SSL settings and return to the main page, click Finish.

Editing U2 server definitionsYou can modify the details of an existing U2 server definition, with one exception. It is not possible tochange the name of the U2 server. However, you can create the U2 server again with a new name.

Prerequisites

Creating U2 server definitions, on page 7

Procedure

1. To start the Edit U2 Server Definition wizard, right-click the name of the U2 server definition in theU2 Resource view, and click Properties.

2. In the Host field, enter the name or IP address of the computer on which UniData or UniVerse isrunning.

3. From the U2 database server options, select UniData or UniVerse.4. Optional: To view or edit the unirpc service name, port number, and other advanced settings

defining the connection, click Advanced.

Go to Viewing or editing advanced settings of a U2 server definition, on page 8.

Tip: The default values for advanced settings work best in most situations. Alter thesesettings only if necessary.

5. To save the U2 server definition, click Finish.The tool creates a directory for the U2 server, registering the server definition so the tool can findit in future sessions. The name of the new U2 server is added to the list in the U2 Resource view.

Importing an existing U2 server definitionYou can import existing U2 server definitions to your XAdmin environment from the XAdmin ResourceView.

Prerequisites

Creating U2 server definitions, on page 7 or Editing U2 server definitions, on page 10

Note: When you import U2 servers, all credential information is included. It is important to limitrestricted access services, depending on your security policy. It is the function of your securityadministrator to determine if U2 servers can be imported with credentials included. You can saveserver resources without password credentials.

Procedure

1. From the U2 Resource View, right-click the Servers icon and then select Import U2 Servers.2. In the Installation path field, enter the location of the server definitions you want to import. This

must be an existing U2 DBTools directory.3. Select the server definitions you want to import, then click OK.

Page 11: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Connecting to U2 servers

11

The imported server now shows in the U2 Resource View.

Connecting to U2 serversYou must open a U2 server connection to work with the accounts stored on the associated UniDataor UniVerse (U2) database server computer. You can connect to any U2 server that is listed in the U2Resource view.

Prerequisites

Creating U2 server definitions, on page 7

Procedure

1. To start the Connect to a U2 Server wizard, double-click the name of the U2 server in the U2Resource view.

2. In the User ID field, enter the administrator user name or the user name of a valid user on theserver computer running UniData or UniVerse.

3. In the Password field, enter the password for the administrator or user on the server computer.4. To store the password for future connections, select the Remember me check box.

With this check box selected, Microsoft Windows stores the encrypted password on the clientcomputer.

5. If you are using a proxy server, select the Use Proxy Server check box.a. In the Proxy Host field, enter the name or IP address of the computer on which the proxy

server is running.b. In the Proxy Port field, enter the number of the port on which the proxy server listens for

communication from UniData or UniVerse.6. To connect to the U2 server, click Connect.

When the connection is established, the U2 Resource view displays a tree view of the U2 accountsand catalog programs on the U2 database server to which you are connected.

Disconnecting from U2 serversAfter completing tasks for a U2 account, you can disconnect from the U2 server. Disconnecting onlycloses the connection to the U2 server. It does not delete the U2 server definition or remove the U2server from the list in the U2 Resource view.

In the U2 Resource view, right-click the name of the U2 server from which you want to disconnect, andclick Disconnect.

Deleting U2 server definitionsIf you no longer require access to the U2 accounts and catalog programs on a U2 database server, youcan delete the associated U2 server definition. It is not possible to change the name of an existing U2server. However, you can delete the U2 server definition and create it again using a new name.

In the U2 Resource view, right-click the name of the U2 server you want to delete, and click Delete.The name of the U2 server and folders for its U2 accounts and catalog programs are removed from thelist in the U2 Resource view.

Page 12: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 2: Getting started

12

Installing and updating the DBTools using the EclipseUpdate Manager

You can update and install any of the U2 DBTools using the Update Manager in Eclipse.

Find the latest information about updates for U2 DBTools at http://updates.rocketsoftware.com/u2.

Procedure

1. Launch any U2 DBTools or base Eclipse installations (beginning with Galileo) on your computer.2. From the Eclipse Help menu, select Help → Install New Software.3. Click Add, enter a name for the site, such as U2 Update Site, and in the Work with field enter

http://updates.rocketsoftware.com/u2. Click OK.4. Allow the repository to load and then expand the tree for U2 DBTools. Select the updates that you

want to apply. You can also choose to install any other U2 DBTools into your existing workspace.5. Click Next and follow the installation wizard to complete the installation of updates.6. Updates will take effect the next time an updated tool is launched.

Note: Only tools that are installed through separate InstallShield installations will appear onthe Start menu. Tools installed using the Eclipse Update Manager are installed as individualperspectives in a single Eclipse instance. You can access the different perspectives by selectingWindow → Open Perspective and then selecting the appropriate tool.

Note: You can check for updates to the DBTools by selecting Help → Check for Updates. To usethis option, you must have previously defined the http://updates.rocketsoftware.com/u2 locationin the Install New Software dialog, as described in step 3.

XTOOLSUBThis topic describes the XTOOLSUB program and how to upgrade to the latest version of XTOOLSUBon various operating systems.

Updating the XTOOLSUB Program

The XTOOLSUB program is a U2 database server-side BASIC program used by various U2 Client Tools.This includes U2 DataVu, U2 Web DE, Basic Developer's Toolkit (BDT), Extensible Administration Tool(XAdmin), Web Services Developer, and more. It also includes any tool that uses the U2 Resource View.

XTOOLSUB updates itself automatically. However, if something happens to the XTOOLSUB programyou can download the latest version from the public Tech Note site at:

https://u2tc.rocketsoftware.com/documentation/1410028.asp

The XTOOLSUB program contains several zip and tar files, and includes three or four files, dependingon the environment. The XTOOLSUB program is used by all the tools, but the other files included areonly used for the Basic Developer's Toolkit (BDT).

The XTOOLSUB_EXECPRE/XTOOLSUB_XPRE programs are for pre-execution functionality andXTOOLSUB_EXECPOST/XTOOLSUB_XPST are for post-execution functionality. These programs arediscussed further in the related public Tech Note, BDT Extensibility Details. If you have added your owncode to the pre- and post-functionality, copy those modified programs to the older database versionsrather than the pre- and post- files located here.

Page 13: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Installing XTOOLSUB for UniData on Windows

13

The files included for UniData are:

▪ XTOOLSUB

▪ XTOOLSUB_EXECPRE

▪ XTOOLSUB_EXECPOST

▪ EDAMAPSUB (UniData 6.1 and lower)

The files included for UniVerse are:

▪ XTOOLSUB

▪ XTOOLSUB_XPRE

▪ XTOOLSUB_XPST

▪ EDAMAPSUB (UniVerse 10.3 and lower)

Do not catalog the EDAMAPSUB subroutine when using UDT 7.1 or UV 11.1 and higher. This programalready exists on those versions.

There is a difference between the databases because UniVerse's catalog environment is a type 1 fileand has a 14–character file name limit.

Only extract the file that is needed for the database server/version and OS type you are using.The ...UX.tar (Unix) files come from AIX. You will need to run fnuxi/convcode if you use other UNIX/Linux operating systems. Files are not included for all operating systems in order to avoid unnecessaryconfusion. The files in the zip/tar files are the object code for the given programs; do not open them ina text editor.

Note: Log in as a root or administrator user when doing these steps to avoid any permissionserrors. If an overwrite message occurs, select "yes" to overwrite the file in question.

Installing XTOOLSUB for UniData on Windows

The XTOOLSUB program is installed and updated automatically through the U2 DBTools updates.However, if your version of XTOOLSUB somehow becomes unusable, you can install a new version.

Procedure

1. Download the latest version of XTOOLSUB from the public Tech Note site at https://u2tc.rocketsoftware.com/documentation/1410028.asp.

2. Copy the XTOOLSUB_UDT_NT.zip or XTOOLSUB_UDT_61_NT.zip file to a temporary directory onyour server (for example, c:\temp).

3. Extract the file to the c:\u2\ud##\sys\SYS_BP (where ## refers to the UniData major version. Forexample, 61, 71, 72, etc.) directory using your preferred unzipping utility. If UniData is installed inanother location, change the path accordingly.

4. Log in to the sys account using telnet or execute a udt shell command in the sys directory on theserver.

5. Catalog the three XTOOLSUB programs, as follows:

▪ CATALOG SYS_BP XTOOLSUB FORCE

▪ CATALOG SYS_BP XTOOLSUB_EXECPRE FORCE

▪ CATALOG SYS_BP XTOOLSUB_EXECPOST FORCE

Page 14: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 2: Getting started

14

Note: If you are using UniData 6.1 or lower, also run the CATALOG SYS_BP EDAMAPSUBFORCE command.

6. Connect with your U2 client tool to the U2 database server.

Installing XTOOLSUB for UniVerse on Windows

The XTOOLSUB program is installed and updated automatically through the U2 DBTools updates.However, if your version of XTOOLSUB somehow becomes unusable, you can install a new version.

Procedure

1. Download the latest version of XTOOLSUB from the public Tech Note site at https://u2tc.rocketsoftware.com/documentation/1410028.asp

2. Copy the XTOOLSUB_UV_NT.zip or XTOOLSUB_UV_103_NT.zip file to a temporary directory onyour server. For example, c:\temp.

3. Extract the file to the c:\u2\uv\BP.O directory using your preferred unzipping utility. If UniVerse isinstalled in another location, change the path accordingly.

4. Log in to the UV home account via Telnet. The account name is UV or uv in the UV.ACCOUNT file.5. Catalog the three XTOOLSUB programs, as follows:

▪ CATALOG SYS_BP XTOOLSUB FORCE

▪ CATALOG SYS_BP XTOOLSUB_EXECPRE FORCE

▪ CATALOG SYS_BP XTOOLSUB_EXECPOST FORCE

Note: You will receive a catalog error if you try to catalog all three programs on the samecommand line.

6. If you are using UniVerse 10.3 or later, also run CATALOG BP *EDAMAPSUB FORCE command.7. Connect with your U2 client tool to the U2 database server.

Installing XTOOLSUB for UNIX/Linux for UniData

The XTOOLSUB program is installed and updated automatically through the U2 DBTools updates.However, if your version of XTOOLSUB somehow becomes unusable, you can install a new version.

The $UDTBIN referenced below is an environment variable pointing to your UniData bin directory, forexample, /usr/ud##/bin (where ##, is 61,71,72, etc.). If this variable is not set, then reference the fullpath to the UniData bin directory in the commands.

Procedure

1. Download the latest version of XTOOLSUB from the public Tech Note site at https://u2tc.rocketsoftware.com/documentation/1410028.asp.

2. Copy the XTOOLSUB_UDT_UX.tar or XTOOLSUB_UDT_61_UX.tar file to a temporary directory onyour server (for example, /tmp). If transferring using ftp, remember to use binary format.

3. Extract the file to the $UDTHOME/sys/SYS_BP directory.

Page 15: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Installing XTOOLSUB for UNIX/Linux on UniVerse

15

a. To install using UniData 6.1 or earlier, the commands will be:cd $UDTHOME/sys/SYS_BPtar -xvf /tmp/XTOOLSUB_UDT_61_UX.tar

b. To install UniData 7.1 or later, the commands will be:cd $UDTHOME/sys/SYS_BPtar -xvf /tmp/XTOOLSUB_UDT_UX.tar

4. If you are using a non-AIX operating system, run the convcode command, as shown: $UDTHOME/sys/SYS_BP: $UDTBIN/convcode .

Note: The convcode command includes a period at the end of the line. This will converteverything in the SYS_BP file to the current format. All files report that they were converted,but this is the default answer for convcode. The existing files should already be in the correctformat.

5. Change directories to the $UDTHOME/sys directory and then and execute the UDT command, asshown:a. CD $UDTHOME/sysb. $UDTBIN/udt

6. Catalog the three XTOOLSUB programs, as follows:

▪ CATALOG SYS_BP XTOOLSUB FORCE

▪ CATALOG SYS_BP XTOOLSUB_EXECPRE FORCE

▪ CATALOG SYS_BP XTOOLSUB_EXECPOST FORCE

Note: If you are using UniData 6.1 or lower, also run the CATALOG SYS_BP EDAMAPSUBFORCE command.

7. Connect with your U2 client tool to the U2 database server.

Installing XTOOLSUB for UNIX/Linux on UniVerse

The XTOOLSUB program is installed and updated automatically through the U2 DBTools updates.However, if your version of XTOOLSUB somehow becomes unusable, you can install a new version.

Procedure

1. Download the latest version of XTOOLSUB from the public Tech Note site at https://u2tc.rocketsoftware.com/documentation/1410028.asp

2. Copy the XTOOLSUB_UV_UX.tar or XTOOLSUB_UDT_UV_103_UX.tar file to a temporary directoryon your server (for example, /tmp). If transferring files using FTP, remember to use binary fileformat.

3. Extract the file to the /usr/uv/BP.O directory. If UniVerse is installed in another location, changethe path accordingly. Use 'cat /.uvhome' to find the path if needed.

Note: `cat /.uvhome` references include single backward quotation marks. This commandretrieves the current value for the UniVerse home directory before running the command.

a. To install using UniVerse 10.3 or earlier, the commands to use are:cd `cat /.uvhome`/BP.Otar -xvf /tmp/XTOOLSUB_UV_103_UX.tar

Page 16: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 2: Getting started

16

b. To install using UniVerse 11.1 or later, the commands to use are:cd `cat /.uvhome`/BP.Otar -xvf /tmp/XTOOLSUB_UV_UX.tar

4. If you are using a non-AIX operating system, run the convcode command, as shown:`cat /.uvhome`/bin/fnuxi XTOOLSUB*

5. Change directories to the UniVerse home directory and then and run the UV command, as shown:a. cd `cat /.uvhome`b. bin/uv

6. Click Escape to exit the menu.7. Catalog the three XTOOLSUB programs, as follows:

▪ CATALOG SYS_BP XTOOLSUB FORCE

▪ CATALOG SYS_BP XTOOLSUB_EXECPRE FORCE

▪ CATALOG SYS_BP XTOOLSUB_EXECPOST FORCE

Note: You will see a catalog error if you try to catalog all three programs on the samecommand line.

8. If you are using UniVerse 10.3 or earlier, also run the CATALOG BP *EDAMAPSUB FORCEcommand.

9. Connect with your U2 client tool to the U2 database server.

Installing XTOOLSUB on Windows

The XTOOLSUB program is installed and updated automatically through the U2 DBTools updates.However, if your version of XTOOLSUB somehow becomes unusable, you can install a new version.

Procedure

1. Download the latest version of XTOOLSUB from the public Tech Note site at https://u2tc.rocketsoftware.com/documentation/1410028.asp

2. Copy the XTOOLSUB_UDT_NT.zip or XTOOLSUB_UDT_61_NT.zip file to a temporary directory onyour server (for example, c:\temp).

3. Extract the file to the c:\u2\ud##\sys\SYS_BP (where ## refers to the UDT major version, i.e. 61, 71,72, etc.) directory using your preferred unzipping utility. If UniData is installed in another location,change the path accordingly.

4. Log into the sys account using telnet or execute a udt shell command in the sys directory on theserver.

5. Catalog the three XTOOLSUB programs, as follows:

▪ CATALOG SYS_BP XTOOLSUB FORCE

▪ CATALOG SYS_BP XTOOLSUB_EXECPRE FORCE

▪ CATALOG SYS_BP XTOOLSUB_EXECPOST FORCE

Note: If you are using UniData 6.1 or lower, also run the CATALOG SYS_BP EDAMAPSUBFORCE command.

6. Connect with your U2 client tool to the U2 database server.

Page 17: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

17

Chapter 3: Managing EDA Replication

Defining EDA Replication parametersYou must configure the parameters specific to EDA Replication.

1. From the U2 Resource pane, right-click the account to which you want to replicate your EDA dataand select EDA replication config tool.

2. From the EDA Replication Config tool, select Configure Replication Parameters.The Configure Replication Parameters pane opens, as shown:

3. To change the value of a configuration parameter, click the New Value column of the parameteryou want to change, then enter the new value for the parameter.

Parameter Description

MAX_LRF_FILESIZE The maximum Log Reserve file size, in bytes. The default valueis 1,073,741,824 (1 GB). The maximum value is 2,147,483,136.

MAX_REP_DISTRIB Reserved for internal use.MAX_REP_SHMSZ The maximum shared memory buffer segment size. The default

value is 67,108,864 (64 MB).

Page 18: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 3: Managing EDA Replication

18

Parameter Description

N_REP_OPEN_FILE The maximum number of open replication log files for a udt ortm process. The default value is 8.

REP_CP_TIMEOUT Specifies the cm daemon timeout interval for replication atcheckpoint. The default value is 200 seconds. If this value is setto 0 the cm daemon will not time out.The REP_FLAG parameter turns UniData Data Replication onor off. If you choose the install UniData with the Replicationfeature, UniData sets the REP_FLAG to 1. The following tabledescribes the REP_FLAG options:Value Description0 (Zero) The UniData Data Replication System

is off.

REP_FLAG (Replication Flag)

Any positive integer The UniData Replication System ison.

REP_LOG_PATH The full path to the location of the replog file.TCA_SIZE The maximum number of entries in the transaction control

area (TCA). TCA is only used when there is more than onereplication group configured, and there are transactions acrossreplication groups. The default value is 2048.

If you are not using transaction processing, this parameter isirrelevant. If you are using transaction processing, set the valueof TCA_SIZE to at least the number of users on the system.

UDR_CONVERT_CHAR When this value is set to 1, if the publishing system and thesubscribing system have a different I18N group, UniDataconverts marks and SQLNULL marks to those on the localmachine on the data passed between the two systems. Thedefault value is 0.

4. Optional. Click Configuration Editor to update or view configuration parameters5. After you make your desired changes, click Save Changes.

Configuring the Replication systemYou must define the system to which you want to replicate EDA data.

1. From the U2 Resource pane, right-click the account to which you want to replicate your EDA dataand select EDA replication config tool.

2. From the EDA Replication Config tool, select Configure Replication System.

Page 19: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Configuring the Replication system

19

3. From the Replication Systems list, select the system to which you want to replicate data.This system should be the same system on which the EDA account resides.The Configure Replication System pane opens, as shown:

4. In the System ID field, enter a unique name for the replication system.The System ID can contain a combination of alphabetic characters, numbers, and any of thefollowing characters: ~ ! @ $ % ^ & * - + . / \.

5. In the Host Name field, enter the host name of the replication system location.A system can have only one host name.

6. In the Version field, select the version of the U2 database running on the system location.7. Select the DHCP check box if the local system has a dynamic IP address.8. Select Yes for Auto Resume if you want to automatically synchronize and resume when the U2

database starts, or No if you want to manually synchronize.9. In the Sync Interval field, enter or select the time interval, in minutes, in which the replication

system automatically synchronizes replication.A value of 0 specifies manual synchronization. The sync interval applies only to those subscribinggroups that have deferred replication.

10. If you want to verify the subscribing system, select the Connect Authorization check box.U2 Data Replication performs an authorization check when it receives a SYNC request from thesubscribing system.

11. In the Timeout field, enter or select the number of seconds to wait if no packets are received fromthe system before suspending replication.

Page 20: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 3: Managing EDA Replication

20

If the value of timeout is 0, no timeout occurs. We recommend not setting this value to less than 2minutes.

12. If you want to execute a shell script on a UNIX platform or a batch program on a Windowsplatform when an exception occurs, specify the full path to the script in the Exception Actionfield, or click Browse to locate the path.

13. The account definition is automatically populated with the account you previously defined. Todefine a different account to replicate EDA data, click Add.

14. Click Save Changes to save your settings.

Choosing files to replicateYou must create a replication group and then choose the files you want to replicate.

1. From the U2 Resource pane, right-click the account to which you want to replicate your EDA dataand select EDA replication config tool.

2. From the EDA Replication Config tool, select Choose Files to Replicate.The Choose Files to Replicate pane opens, as shown:

Page 21: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Defining a data source

21

3. If you have not previously defined a replication group, click Create from the ConfigureReplication Group window.

4. In the Group ID field, enter a unique name for the subscribing group.5. Open the Source Account list and select the source account from the list.6. In the Level field, select the level of replication. For EDA Replication, you can only choose FILE.7. In the Files area, click Add to select the files you want to publish.8. If you do not want to publish the data portion of the file, clear the Data check box. If you do not

want to publish the dictionary portion of the file, clear the Dict check box.9. To enable the ability to update the file on the subscribing system, select the Sub Writeable

column.10. In the Distributions area, click Add to define replication distribution details.11. In the System Name field, select the local system from the list.12. Select the Replication mode you want to use.13. Click Finish.14. If you want this publishing group to automatically failover to a standby system, select the

standby system in the RFS Failover System field.15. Set any of the configuration parameters necessary for your environment in the Configuration

area.16. Click Save Changes.

Defining a data sourceYou must define a data source pointing to the external database to which you want to connect.

1. After you connect to your U2 server, right-click EDA Data Sources, then click New EDA DataSource.

2. In the Name field, enter a unique name to identify the external data source. The name cannotcontain a slash (/) or backslash (\) character.

3. In the DSN/Net Service/DB Alias field, enter the name of the external database to which you areconnecting. The name must be the data source defined in the ODBC Data Source Administrator.

4. From the Driver list, select the type of driver.5. To define an EDA data source connection, click Add.

Defining an EDA data source connectionYou must define a data source pointing to the external database to which you want to connect.

1. In the Login User ID field, enter the user ID on the external server.2. In the Password field, enter the password corresponding to the user ID.3. In the Re-enter Password field, type the password again for verification.4. In the Hold Flag field, select YES if you want to maintain the connection on the external server

after a transaction commits. Select NO if you want to disconnect from the external server afterthe transaction commits.

5. In the Qualified Users field, enter the UniData or UniVerse user IDs of users who can access theexternal server from the UniData or UniVerse account using the external login user ID you specify.Separate the users by a pipe ("|") symbol. If all users can access the external account, enter anasterisk ("*").

6. Click Test to test the connection to the external data source.

Page 22: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 3: Managing EDA Replication

22

Synchronizing replication filesYou must synchronize the files from the source account with the target account.

1. Select the files from the source account that you want to synchronize with the target account.2. Click Start File Synchronization.3. Choose whether to overwrite existing files in the target account.

Creating default EDA schemas for the replicated filesYou can create a default EDA schema for the files you selected, which maps each D-type attribute, orselect the attributes you want to map.

1. Click Create EDA Schemas for the Replicated Files.2. Select the files for which you want to create schemas.3. Click Create EDA Schemas.4. Select the data source for which you are creating the schema from the list.5. Click OK.6. EDA Replication pauses the database and maps each D-type attribute in the dictionary file.7. If you want to view the schema that was created, click Open EDA Schemas.

Creating EDA schemas for selected attributesYou can select the dictionary attributes you want to map.

1. Click Create EDA Schemas for the Replicated Files.2. Select the files for which you want to create schemas.3. Click Create EDA Schemas.4. Select the data source for which you want to create schemas from the Data Source list, or click

New Data Source to create a new data source.5. Click Deselect All, then select the dictionary attributes for which you want to create a schema.6. If you are creating schemas for multiple files, click the arrow next to the current file name to

advance to the next file.7. Click Finish when you have selected all the dictionary attributes for which you want to create

schemas.8. If you want to view the schema that was created, click Open EDA Schemas.

Converting U2 files to EDA filesYou can convert the U2 file to an EDA file.

1. Select the files you want to convert. Make sure you have synchronized the files before you convertthem.

2. Add an attribute to the EDA Schema in the editor, as described in Creating EDA schemas forselected attributes, on page 22.

3. Click Convert the U2 File to EDA File.4. Select the type of conversion you want to use:

▪ Force – Drops existing tables before creating new ones

▪ Verbose – Show detailed messages during the conversion process

Page 23: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Converting U2 files to EDA files

23

5. Click EDA Convert.The database suspends replication during the altering process, and the file is converted to an EDAfile.

Page 24: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

24

Chapter 4: The EDA Schema Manager

The EDA Schema Manager stepsThe conversion of UniData or UniVerse files to external tables and views is shown in the followingdiagram:

The EDA Schema Manager performs the following steps when converting UniData or UniVerse files tothe external database:

1. The EDA Schema Processor receives information from the UniData or UniVerse Dictionary file forthe data file you are converting and other user input.

2. From this information, the EDA Schema Processor creates an EDA Schema. This EDA Schema is arecord in the _EDAMAP_ (UniData) or &EDAMAP& (UniVerse) file.

3. Optionally, you can verify the EDA Schema.4. The conversion process uses the EDA Schema record and the UniData or UniVerse physical file to

create tables and views in the external database.5. The UniData or UniVerse physical file is replaced by an EDA file in the UniData or UniVerse

account. The original data file is saved under filename.edasave. It does not contain datasince all data has been transferred to the corresponding external tables.

The EDA Schema ManagerUse the EDA Schema Manager to create a mapping file, called EDA Schema, for a UniData or UniVersefile you are converting to the external database. You then convert UniData or UniVerse data to theexternal database using this mapping file.

To access the EDA Schema Manager, from the Start menu, select Programs > Rocket U2 > EDASchema Manager. The EDA Schema Manager appears, as shown in the following example:

Page 25: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Create a new UniData or UniVerse server connection

25

Create a new UniData or UniVerse server connection

To create a new UniData or UniVerse server connection, perform the following steps.

1. Right-click Servers and select New U2 Server.A dialog box similar to the following example appears:

2. In the Name field, enter a unique identifier for the new server.

Page 26: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

26

3. In the Host field, enter the network name of the host computer where the UniData or UniVersedatabase resides, or the IP address.

4. From the U2 database options, select UniData or UniVerse.5. If you want to define the protocol type, RPC port number, RPC service name, or the login account,

click Advanced.A dialog box similar to the following example appears:

a. In the Protocol Type field, select the type of communication you are using for the server. Youcan select Default, TCP/IP, or Lan Manager. The default is TCP/IP.

b. In the RPC Port # field, enter the port number of the UniRPC server running on the host. Thedefault port number is 31438.

c. In the RPC Service Name field, enter the name of the RPC service on your system. ForUniData, this is normally udcs For UniVerse, this is normally uvcs.

d. In the Login Account field, enter the name of the account to which you want to log on whenaccessing UniData or UniVerse.

e. In the Commands to Execute field, click Add to enter commands that you want to executewhen you log on to the server.The following dialog box appears:

Enter the commands you want to execute, then click OK.

f. In the Specify the session to run/debug your BASIC programs on server side area, specifythe type of connection that you want to make to the server. You can specify Telnet or SSH.

g. In the Port Number field, enter the port number you want to use if you do not want to usethe default port number of 23.

h. Select the Use Device License check box if you want to enable device licensing whenconnecting to the server.

6. Click Finish to establish the UniData or UniVerse server.The new server appears in the U2 Servers area.

Connecting to the UniData or UniVerse server

To connect to the UniData or UniVerse Server, perform the following steps.

1. Right-click the server name, then click Connect.When you connect to the server, the Connect to U2 Server dialog box appears.

2. In the User ID field, enter the User ID for the machine where UniData or UniVerse is running.3. Enter the corresponding password in the Password field.

Page 27: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Managing connections

27

To store the password for future connections, select the Remember me check box. With this checkbox selected, Microsoft Windows stores the encrypted password on the client computer.

4. If you are using a proxy server, select the Use Proxy Server check box.a. In the Proxy Host field, enter the name or IP address of the computer on which the proxy

server is running.b. In the Proxy Port field, enter the number of the port on which the proxy server listens for

communication from UniData or UniVerse.5. Click Finish.

The accounts and existing data sources definitions appear in the U2 Server area.

Managing connectionsYou must define a data source pointing to the external database to which you want to connect.

About data sources

You must define a data source pointing to the external database client residing on the machine whereUniData or UniVerse is installed. UniData and UniVerse support the following three types of externaldatabases:

▪ IBM DB2

▪ Microsoft SQL Server

▪ Oracle Database

Note: For more information regarding the external database that you are accessing, westrongly suggest reading about the supplied drivers in the UniData EDA User Guide or UniVerseEDA User Guide manual before proceeding.

An external database server may reside on the same or different machine from the UniVerse servermachine, but the corresponding client must reside on the same machine where the UniVerse server isinstalled. The following diagrams describe typical client-server configurations.

Connecting to SQL Server, Oracle, or the IBM database

The UniData or UniVerse database server may reside on UNIX, Linux, or Windows. After the SQL Server,Oracle, or DB2 database server is installed, the appropriate ODBC driver must be installed on theUniData or UniVerse database server machine. The drivers for access to the databases are:

▪ SQL Server - Open Source or third-party ODBC library for UNIX

▪ SQL Server - Native client for Windows

▪ Oracle - Oracle Client Library (OCI)

▪ DB2 - DB2 Client Library (CLI)

The UniData or UniVerse installation automatically places the EDA Driver Library for S2L Server(libcomdrv), the EDA Driver Library for Oracle (liboradrv), and the EDA Driver Library for DB2(libdb2drv) and the in the $UDTBIN (UniData) or $UVBIN (UniVerse) directory.

Page 28: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

28

The following example shows how UniData or UniVerse connects to an Oracle server:

The next example shows how UniData or UniVerse connects to a DB2 server:

The next example shows how UniData or UniVerse connects to SQL Server from a UNIX or Linuxplatform:

Connecting to Microsoft SQL Server using the Native Client

To use the native Microsoft SQL Server client, the database must reside on a Windows platform. Afterthe SQL Server database is installed, the appropriate SQL Server Client Library (Native Client) must be

Page 29: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Defining a data source

29

installed on the UniData or UniVerse database server machine. The UniData or UniVerse installationautomatically places the EDA Driver Library for SQL Server (libsqldrv) in the $UDTBIN (UniData) or$UVBIN (UniVerse) directory.

The following example shows how UniData or UniVerse connects to SQL Server from a Windowsplatform:

Defining a data sourceYou must define a data source pointing to the external database to which you want to connect.

To define a new data source, connect to your UniData or UniVerse server, right-click Data Sources,then click New EDA Data Source. The Create a New EDA Data Source dialog box appears, as shown inthe following example:

In the Enter Data Source Name box, enter a unique name for the external data source, then clickFinish.

A data source information dialog box appears in the right pane of the EDA Schema Manager window,as shown in the following example:

Page 30: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

30

In the External DB Name box, enter the name of the external database client that provides theconnection to the desired external database instance. For Microsoft SQL Server, it is the name of theODBC Data Source you have defined in ODBC Data Source Administration. For DB2, it is the databasename specified in the CATALOG DATABASE command. For Oracle, it is the connection name definedin the tnsnames.ora file.

In the Driver box, enter the type of driver.

Click Add. The EDA Data Source Connection dialog box appears, as shown in the following example:

Page 31: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Defining a data source

31

In the Login User ID box, enter the user ID on the external server.

In the Password box, enter the password corresponding to the User ID. Enter the password again inthe Re-enter Password box.

If you want to maintain the connection to the external server after a transaction commits, select YESin the Hold Flag box. If you want to disconnect from the external server after the transaction commits,select NO in this box.

Note: If you do not use UniVerse BASIC transactions, each UniData or UniVerse databaseoperation, such as a READ or WRITE, corresponds to an external transaction.

In the Qualified Users box, enter the UniData or UniVerse user IDs of users who can access theexternal server from the UniData or UniVerse account using the external Login User ID you specify.Separate the users by a “|” symbol. If all UniData or UniVerse users can access the external account,enter an asterisk (“*”).

The following example shows a completed EDA Data Source dialog box:

To test the connection to the external instance, click Test. If the connection is successful, a messagesimilar to the following example appears:

Page 32: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

32

From the File menu, click Save to save your data source definition, or click the Save icon.

Selecting EDA schema filesFrom the EDA Schema Manager, expand Accounts, expand the UniData or UniVerse account where thefiles you want to convert reside, right-click the EDA Schema Files, then click New EDA Map Schema.The Create New EDA Map Schema dialog box appears, as shown in the following example:

In the EDA Schema Name box, enter a unique name for the EDA schema. Select EDA Schema forthe Map Format, then click Next. The Source U2 file dialog box appears, as shown in the followingexample:

Page 33: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Selecting EDA schema files

33

In the file list, highlight the UniData or UniVerse file for which you are creating a schema. Click Next.

The U2 Dictionary Attributes dialog box appears, as shown in the following example:

Page 34: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

34

The EDA Map Schema displays each D-type dictionary attribute for the file you specified. Selecteach dictionary attribute you want to map to the external database. To select all D-type dictionaryattributes, click Select All. To clear all dictionary attributes, click Deselect All. For selective mappingor virtual field mapping, you must click Deselect All.

Selectively mapping attributes

If you want to selectively map UniData or UniVerse attributes to an external database, only selectthose attributes you want to map from the U2 Dictionary Attributes dialog box when creating the EDAMap Schema. If you do not select any dictionary attributes, UniData or UniVerse automatically mapsthe @ID attribute.

Page 35: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Selectively mapping attributes

35

In the following example, only the LNAME and @ID attributes have been selected:

The following example illustrates the appearance of the window after the LNAMEattribute has beenselected. Notice that a red arrow appears next to the attribute in the U2 File Dictionary portion of thewindow, indicating the attribute has been mapped.

Page 36: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

36

Note: The EDA Schema Manager allows 30-character column names for Oracle and DB2 and 60-character column names for SQL Server. If the dictionary ID length is longer, it will be truncated inthe EDA Map Schema portion of the window.

Attribute details

In the Attribute Details portion of the window, define the mapping details for the attribute youselected.

Note: You can change the name, type, data type, formatting, Database name, Namespace, andData source. Namespace refers to the external schema name where the conversion process willcreate the corresponding external tables and views.

▪ The Name attribute is the name of the column in the resulting external table.

▪ In the Type box, select the type of attribute.

▪ In the Data Type box, enter the data type for the attribute. In this case, the data type is VARCHAR.

▪ The Reference box is used for I-type attributes that contain a TRANS clause. Enter the nameof the external table TRANS clause reference in this box. For example, if you are mapping theDESCRIPTION attribute from the CUSTOMER file, drag the attribute under ORDERS_MV, as shown inthe following example:

As you can see in the Mapped U2 Fields portion of the window, this attribute contains a TRANSfunction to the PRODUCTS file. In the Reference box, enter the external table and column wherethe EDA CUSTOMER file was mapped, in this case, PRODUCT.PRODUCT/DESCRIPTION.

▪ In the Parameters box, specify the attribute or expression in the TRANS function that returns therecord ID in the table you are referencing in the external database. For example, the record ID forPRODUCTS is PRODID. Click the plus sign (“+”) in the Parameters portion of the window. EnterPRODID in the Parameter box, as shown in the following example:

Page 37: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Attribute details

37

▪ If the attribute is an expression, enter the SQL expression in the Expr Body box. For example, theFULLNAME attribute in the CUSTOMER file concatenates the salutation, space, first name, space,and last name attributes. In the expression box, enter the corresponding SQL statement for thisattribute, as shown in the following example:

▪ In the Formatting box, select the appropriate format for the attribute.

▪ The Index box is not supported at this release of UniData or UniVerse.

Page 38: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

38

Note: If you select all dictionary attributes, UniData or UniVerse only maps D-type attributes.You must map I–descriptors manually.

In addition, you cannot map unassociated multivalued or I-descriptors. You also cannot mapassociations that contain only I-descriptors.

View EDA server details

To view information about the EDA Server, click the external Schema Name/Table Name in the EDAMap Schema area of the U2 EDA Schema Manager. Information about the EDA server appears, asshown in the following example:

The U2 EDA Schema Manager displays the following details about the EDA server:

▪ The DBInstance box displays the name of the instance on the EDA server.

▪ The DBMSName box displays the name and version of the database on the EDA server.

▪ The DBMSFamily box displays the database family to which the DBMS name belongs.

▪ The DBModel box displays the type of database. At this release, UniData or UniVerse only supports1NF databases.

▪ The Name Space (Schema) box displays the name of the schema on the EDA server. You canchange the name of the schema.

▪ The Root Name box displays the name of the table on the EDA server. You can change the name ofthe table.

▪ The Data Source box displays the name of the data source on the EDA server.

View UniData or UniVerse server details

To view information about the UniData or UniVerse server, click the UniData or UniVerse file namein the EDA Map Schema area of the U2 EDA Schema Manager. Information about the UniData orUniVerse server appears, as shown in the following example:

Page 39: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

View options

39

The U2 EDA Schema Manager displays the following details about the UniData or UniVerse server:

▪ The Host box displays the name of the UniData or UniVerse host server where the file resides.

▪ The U2 System box displays the type of database on the server where the file resides.

▪ The U2 Version box displays the version of the database on the UniData or UniVerse server wherethe file resides.

▪ The U2 Account box displays the full path to the account on the UniData or UniVerse server wherethe file resides.

▪ The File Name box displays the name of the file on the UniData or UniVerse server.

View options

To view information about the mapping options, click Options in the EDA Map Schema area of theU2 EDA Schema Manager. Information about the mapping options server appear, as shown in thefollowing example:

The following mapping options are available:

Whole record

The Whole Record option specifies whether or not to store the entire UniData or UniVerse record inthe RECORD_BLOB column on the EDA server at the same time the individually mapped UniData orUniVerse fields are written to their mapped columns. This option may improve the performance of

Page 40: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

40

READ operations, especially when mapping multivalued and multi-subvalued attributes since youavoid complex outer-joins.

If the value of Whole Record is Yes, the entire UniData or UniVerse record will be stored in theRECORD_BLOB on the EDA server. If the value is No, only unmapped fields are stored in theRECORD_BLOB. The default value is No.

If you choose the WHOLE_RECORD option, you should not be updating the data from the externaldatabase, and only update it through UniVerse BASIC or UniData or UniVerse SQL. A failure to complywith this rule can result in inconsistent data.

Unmapped field block (KB)

The Unmapped Field Block option defines the size of the Character Large Object, expressed inkilobytes. The default value is 16. You can change this value to meet your needs. This Character LargeObject, called RECORD_BLOB, serves several purposes:

▪ To hold all attributes that are not explicitly mapped

▪ To hold the entire UniData or UniVerse record when the WHOLE_RECORD flag is set to “Yes”

▪ To hold nonconforming records

Nonconforming record

A nonconforming record is a UniData or UniVerse record that generates an exception error when it iswritten to the EDA server database, but does not cause an error in the UniData or UniVerse database.The Nonconforming Record option enables you to tell UniData or UniVerse not to return validationor truncation errors generated by the external database to your application, so the behavior of yourapplication does not change. For example, UniData or UniVerse allows you to store a text string in anattribute defined as having a numeric conversion, such as MD2, Date or Time, but this will generate anerror in the external database.

If the value of Nonconforming Record is set to Yes, a NONCONFORMING_FLAG column is created inthe EDA file. When a UniData or UniVerse record is determined to be a NONCONFORMING record, theID of that record is inserted in the primary key column of the external table, the NONCONFORMINGcolumn is set to 1, and the entire UniData or UniVerse record is written to the RECORD_BLOB column.In this case, no error is returned to the UniData or UniVerse application. If UniData or UniVerseattempts to write the nonconforming data to a RECORD_BLOB that is not large enough to containthe data, the write fails and UniData or UniVerse writes the record to the EDA_EXCEPTION file on theUniData or UniVerse database and an error is returned to the UniData or UniVerse application. If thevalue of Nonconforming Record is No, the nonconforming data is only written to the EDA_EXCEPTIONfile on the UniData or UniVerse database and an error is returned to the UniData or UniVerseapplication.

For more information about retrieving nonconforming data, see the information onSELECT.EDA.NONCONFORMING in the UniData EDA User Guide or UniVerse EDA User Guide.

Table space

A Table Space is the basic storage structure on an external database. By default, UniData or UniVersecreates all tables in USERSPACE 1, the default user table space. This table space has a 4 KB page size,so the length of a row of a table is limited to less than 4 KB. If the row length is exceeded, UniData orUniVerse generates an error during the conversion process.

You can change the default page size in the Table Space (KB) box. The maximum page size is 256KB. When you select a table space size, for example, 8 KB, the EDA Schema Manager creates the tablespace EDATBSPC8K if it does not already exist, then creates the EDA tables in this table space.

Page 41: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

View field details

41

View field details

To view the details of a mapped attribute, click the attribute you want to view from the EDA MapSchema portion of the dialog box. For example, the following window appears if you click the FNAMEattribute:

The Attribute Details area of the screen displays information about the attribute you selected.

▪ The Name box displays the name of the mapped attribute.

▪ The Type box displays the type of attributes. Valid types at this release of UniData or UniVerse are:▫ DATA – used to store attribute values allowed by the data type you specify. This option creates

a column in the external database. If this is a D-type attribute, its values are stored in thiscolumn. If it is defined as a virtual attribute, or V-type, the virtual attribute is evaluated inUniData or UniVerse, and the result is stored in this column in the external database. 

▫ EXPRESSION – used for I-descriptors only. Enter the SQL expression for the I-descriptorattribute in the Expr Body box, such as FNAME CONCAT ‘ ‘ CONCAT LNAME.

▫ ID DATA – the primary key in the external table

▫ NOT NULL DATA – specifies that the external database column cannot contain the null value.

▫ SCALAR FUNCTION – used to define a scalar function to execute an equivalent virtual attributeon the external database. For information about creating a scalar function, see Scalar functionexample, on page 42.

▫ TABLE FUNCTION – used to define a table function For information about creating a tablefunction, .

▫ TRANS – used for I-descriptor attributes containing a TRANS clause only. If you specify TRANS,you must also specify Reference and Parameters. For more information, see TRANS example,on page 43.

▫ UNIQUE DATA – specifies that values in the external database column must be unique

▪ The Data Type box displays the data type for the mapped attribute. The EDA Schema Managerautomatically converts the data type based on the dictionary record. If an application attempts toinsert or update an external attribute with a value that does not match the data type you define,the EDA system rejects the operation.

▪ The Reference box applies to a I-descriptor. This value should be the name of the column theTRANS function references in the external table, or the reference for a scalar or table function.

▪ The Expr Body box applies to I-descriptor that contain a user-defined function or expression. Usethe Expr Body box to enter the equivalent SQL statement for the expression or function.

Page 42: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

42

▪ The Indexed box indicates if you want to create an index on the mapped external attribute. If youwant to specify the name of the external index, enter the following in the Index box:

REMOTE [externalDB_indexname]If you do not specify the external index name, the EDA process generates one.

▪ The Parameters box specifies the attribute or expression in the function that returns the record IDin the table you are referencing in the external database. 

Scalar function exampleAssume you have the following I-descriptor attribute defined for the CUSTOMER file in your UniVersedatabase:

:AE DICT CUSTOMER UPCASE.LNAMETop of "UPCASE.LNAME" in "DICT STUDENT", 6 lines, 25 characters.001: I002: UPCASE(LNAME)003:004:005: 30L006: S

This I-descriptor converts the customer’s last name to uppercase.

To convert this I-descriptor to a scalar function using the EDA Tool, drag UPCASE.LNAME from theU2 File Dictionary pane under CUSTOMER in the EDA Map Schema pane, as shown in the followingexample:

In the Attribute Details portion of the window, change the Type to SCALAR FUNCTION.

Define the data type for the output in the Data Type box.

In the Reference box, enter the external database function and data type for the value you are passingto the function. In this example, a DB2 system function corresponding to the UniData or UniVerseUPCASE function is UCASE, which resides in the SYSFUN Schema in the DB2 database. Enter thefollowing formula in the Reference box:

SYSFUN.UCASE(VARCHAR(30))

In the Parameters box, click the plus sign (“+”) and enter the field to pass to the scalar function. TheAttribute Details should now look like the following example:

Page 43: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

TRANS example

43

The following example illustrates the output from UniData or UniVerse when you execute this scalarfunction:

>LIST CUSTOMER UPCASE.LNAMELIST CUSTOMER UPCASE.LNAME 03:48:02pm 09 Jun 2010 PAGE 1CUSTOMER.. .............................2 MORRIS4 KAHN6 BURKE3 ARGONNE5 WILLIAMS7 GILL10 MCCAIG8 HOLLAND12 PATRY1 SMITH9 ORLANDO11 LEWIS12 records listed.

TRANS exampleThe next example illustrates a TRANS function. Assume you have the following UniData or UniVersevirtual attribute defined in the dictionary of the CUSTOMER file:

001: I Product description002: TRANS(PRODUCTS,PRODID,DESCRIPTION,"C")003:004: Product Description005: 20T006: M007: ORDERS

This I-descriptor executes a translate from the CUSTOMER file to the PRODUCTS file and returnsDESCRIPTION. To convert this I-descriptor to a trans function using the EDA Tool, drag DESCRIPTION

Page 44: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

44

from the U2 File Dictionary pane under the ORDERS_MV node of CUSTOMER in the EDA Map Schemapane, as shown in the following example:

Click DESCRIPTION in the EDA Map Schema portion of the window to define the Attribute Details forthis function. The following example illustrates the details of the DESCRIPTION function:

In the Attribute Details portion of the window, change the Type to TRANS.

Define the data type for the output in the Data Type box.

In the Reference box, enter the name of the external table that contains the DESCRIPTIONinformation. In this example, the information resides in PRODUCTS.PRODUCTS/DESCRIPTION.

In the Parameters box, click the plus sign (“+”) and enter the field to pass to the TRANS function. Inthis example, PRODID is passed to the TRANS function. The following example illustrates output fromthe DESCRIPTION TRANS scalar function:

Page 45: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Table function example

45

Table function exampleTable functions are valid for the DB2 database only. UniVerse allows you to use the external tablefunction concept to evaluate multiple I-descriptors at the same time. In some cases, you may be ableto map more than one I-descriptor with one external user-defined table function.

Assume you create a monthly report containing product descriptions and prices. To create this reportfrom UniVerse, you use the following I-descriptors for product description and list price:

:AE DICT CUSTOMER DESCRIPTION001: I002: TRANS(PRODUCTS,PRODID,DESCRIPTION,“C”)003:004: Product Description005: 20T006: M007: ORDERS :AE DICT STUDENT LIST_PRICE001: I002: TRANS(PRODUCTS,PRODID,LIST,”C”) 003:MD0,$004: List Price005: 7R006: M007: Orders

To map these I-descriptors, drag each one from the U2 File Dictionary pane to the ORDERS_MV nodein the EDA Map Schema pane, as shown in the following example:

Page 46: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

46

Although you map DESCRIPTION and LIST_PRICE separately, some external databases allow you tocreate one function for use with multiple attributes. You have to define the EDA Map Schema for bothI-descriptors, but you only have to define the function once.

The following example illustrates how you would use a DB2 table function in order to evaluate bothDESCRIPTION and LIST_PRICE on the DB2 database.

First, let’s map the DESCRIPTION I-descriptor:

In the Attribute Details portion of the window, change the Type to TABLE FUNCTION.

In the Data Type box, enter the data type for the output of the attribute you specified in the Namebox.

In the Reference box, enter the external database schema name, the name of user-defined functionyou are defining in the Expr Body box, the data type for the input value, and the external functionattribute name, as shown in the following example:

CUSTOMER2.GET_PRODUCT(VARCHAR(20))/DESCRIPTION

Page 47: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Table function example

47

In this example. the user-defined function will be named GET_PRODUCT and reside in the CUSTOMER2schema in the external database. The data type of the input parameter is VARCHAR(20), and you areusing the output parameter PRODUCT.

In the Expr Body box, enter the table function body. In this example, the function is defined as:

PRODIDF1:BEGIN ATOMIC RETURN SELECT B.DESCRIPTION, B.LIST_PRICE FROM PRODUCTS.PRODUCTS AS B WHERE B.ID=PRODID; END

In the Parameters box, click the plus sign (“+”) to define the parameter to pass to the table functionand the output parameters you want to return. For output parameters, you specify OUTPUT, the nameof the attribute to return, and the data type. In this example, the output parameters are defined as:

OUTPUT DESCRIPTION VARCHAR(50)OUTPUT LIST_PRICE VARCHAR(10)

The following example shows the DDL scripts UniVerse creates for this table function:

CREATE FUNCTION CUSTOMER2,GET_PRODUCT(PRODID VARCHAR(5)) RETURNSTABLE(DESCRIPTION VARCHAR(50),LIST_PRICE VARCHAR(10))F1:BEGIN ATOMIC RETURN SELECT B.DESCRIPTION,B.LIST_PRICE FROM PRODUCTS.PRODUCTS AS B WHERE B.ID=PRODID; END

Next, let’s map the LIST_PRICE I-descriptor.

Click the LIST_PRICE attribute. The following example illustrates the Attribute Details for thisattribute:

In the Attribute Details portion of the window, change the Type to TABLE FUNCTION.

In the Data Type box, enter the data type for the output of the attribute you specified in the Namebox.

Page 48: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

48

In the Reference box, enter the DB2 Schema name, the name of user-defined function you previouslydefined in the DESCRIPTION table function (GET_PRODUCT), the data type for the input value, and theexternal database function attribute name, as shown in the following example:

CUSTOMER2.GET_PRODUCT(VARCHAR(5))/LIST_PRICE

In this example. the user-defined function GET_PRODUCT resides in the CUSTOMER2 schema in theDB2 database. The data type of the input parameter is VARCHAR(5), and you are using the outputparameter LIST_PRICE.

Since you previously defined the GET_PRODUCT function, you do not need to enter data in the ExprBody.

In the Parameters box, click the plus sign (“+”) to define the parameter to pass to the tablefunction. You do not need to define the output parameters since they were previously defined in theGET_PRODUCT function.

Note: For information about creating external database user-defined functions, see the externaldatabase documentation.

Verifying the EDA schemaAfter you have created an EDA Schema, you can verify the EDA Schema.

To verify the EDA Schema, click the Verify icon on the toolbar ( ).

A dialog box similar to the following example appears:

Page 49: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Viewing the EDA schema

49

To verify the EDA Schema, click the type of verification to execute. Valid options are:

▪ Syntax – Verifies the syntax of the SQL statements to create the external tables is correct.

▪ Metadata – Verifies that all the metadata required to create the external tables exists.

▪ Data – Verifies that the UniVerse data meets the requirements for the external tables. You canselect one of the following options when verifying your data:▫ All Records – analyzes each record in the UniVerse data file

▫ Specified Records– you can enter specific record IDs to analyze. Separate each record ID with aright parentheses (}).

▫ First n Records – the system verifies the first n records you specify.

▫ Every n-th Records – the system verifies every n-th record you specify.

Viewing the EDA schemaIf you want to view the EDA schema, click Show Schema. The schema appears in the dialog box, asshown in the following example:

Page 50: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

50

Changing the schemasUniData only. You can alter or change existing schemas without having to reolad the existing tables.

Prerequisites

Procedure

▪ UniData only

▪ Only ADD attributes are allowed in S-field or MV/MS fields

▪ The fields must located in the existing tables

▪ The server options cannot be changed, while the client options can be different

▪ The WHOLE RECORD and UNMAPPED settings must not affect the BLOB field definitions. Thesettings must be either WHOLEREC=1, or UNMAPPED = 0 and Non-Conforming= No

Procedure

1. Click Create EDA Schemas for the Replicated File.2. Select the files for which you want to alter the schemas.3. Click Open EDA Schemas.4. Add the new dictionary to the EDA Map Schema and save the schema.5. Click Convert the U2 File to EDA File.6. Select the type of conversion you want to use:

▪ Force – Drops existing tables before creating new ones

▪ Verbose – Show detailed messages during the conversion process7. Click EDA Alter .

Note: For more information about the ALTER.EDAMAP command, refer to the UniDataExternal Database manual.

Page 51: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Viewing the DDL scripts

51

The database suspends replication during the conversion process, and the new attribute isappended to the table without having to reload the table.

Viewing the DDL scriptsTo view the DDL script that UniData or UniVerse will use to generate the data on the external

table, click the DDL Scripts icon on the toolbar ( ).

Get DDL Scripts appear in the window, as shown in the following example:

Converting dataYou can convert data from UniData or UniVerse to the external database.

1. Click the Convert Data icon ( ).2. In the Convert the U2 File to EDA File window, select the type of conversion you want to use:

▪ Click Force if you want to drop existing tables on the external database before creating newones. You must select this option if you are reconverting data.

▪ Click Verbose to display detailed messages and the DDL scripts during the conversion process.

3. Click EDA Convert. If the conversion is successful, UniData or UniVerse reports the number ofrecords converted to the DB2. If the conversion is not successful, error messages are reported inthe window.

Page 52: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Chapter 4: The EDA Schema Manager

52

Viewing EDA files

To see which files have been converted from UniData or UniVerse to the external database, from theEDA Schema Manager, click the plus sign next to EDA Files, as shown in the following example:

Listing and selecting dataYou can use RetrieVe, UniData or UniVerse SQL, and UniVerse BASIC to access the data on the externaldatabase.

Listing data using RetrieVe

You can use the RetrieVe LIST command to view the converted data on the external database, asshown in the following example:

Page 53: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Listing data using UniData or UniVerse SQL

53

Listing data using UniData or UniVerse SQL

You can use the UniData or UniVerse SQL SELECT command to view the converted data on theexternal database, as shown in the following example:

 

Page 54: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

54

Appendix A: Working with U2 virtual fieldsagainst SQL Server 2008

This appendix provides some examples for working with UniVerse virtual fields against SQL Server2008. In the UniVerse External Database Access (EDA) manual, the virtual field mapping examplesmight work with DB2 or Oracle, but not for SQL Server.

Examples

When creating a new EDA Map Schema, the EDA tool only maps the D-type fields, not virtual fields. Theprimary key field is set to ID DATA type and the other fields are set to DATA type.

Adding the FULLNAME virtual field to a schema map

To create the schema map, add the FULLNAME virtual field to the CUSTOMER schema map. TheFULLNAME virtual field will concatenate the first name with the last name. The type field can bedefined as DATA or EXPRESSION.

When the type is defined as a DATA type, the FULLNAME field will be physically created and part of theCUSTOMER.CUSTOMER table.

The following code sample demonstrates the SQL syntax to create the CUSTOMER.CUSTOMER table:

CREATE TABLE CUSTOMER.CUSTOMER(FULLNAME VARCHAR(120), ID VARCHAR(20) NOT NULL, SAL VARCHAR(10), FNAME VARCHAR(24), LNAME VARCHAR(32), COMPANY VARCHAR(40), ADDR1 VARCHAR(60), ADDR2 VARCHAR(60), CITY VARCHAR(24), STATE VARCHAR(4), ZIP VARCHAR(60), PHONE VARCHAR(60), NONCONFORMING_FLAG SMALLINT, UNMAPPED_U2FIELD VARCHAR(MAX), PRIMARY KEY (ID))

When defined as an expression type, the FULLNAME field will be part of CUSTOMER.CUSTOMER_Vview.

The following code sample demonstrates the SQL syntax to create the CUSTOMER.CUSTOMER_V view:

CREATEVIEWCUSTOMER.CUSTOMER_V(FULLNAME, ID, SAL, FNAME, LNAME, COMPANY, ADDR1, ADDR2, CITY, STATE, ZIP, PHONE, NONCONFORMING_FLAG, UNMAPPED_U2FIELD) AS SELECT FNAME+' '+LNAME, CUSTOMER.ID, CUSTOMER.SAL, CUSTOMER.FNAME, CUSTOMER.LNAME, CUSTOMER.COMPANY, CUSTOMER.ADDR1, CUSTOMER.ADDR2, CUSTOMER.CITY, CUSTOMER.STATE, CUSTOMER.ZIP, CUSTOMER.PHONE, CUSTOMER.NONCONFORMING_FLAG, CUSTOMER.UNMAPPED_U2FIELD FROM CUSTOMER.CUSTOMER CUSTOMER

Adding the UPCASELNAME virtual field to the schema map

To update the schema map, add the UPCASE.LNAME virtual field to the CUSTOMER schema map. TheUPCASE.LNAME virtual field will change the case of the last name to upper case using the SQL ServerUPPER function. The type field can be defined as DATA or EXPRESSION.

The following sample code demonstrates the SQL syntax to create the CUSTOMER.CUSTOMER_V viewusing the UPPER function.

CREATE VIEW CUSTOMER.CUSTOMER_V( UPCASE_LNAME, ID, SAL, FNAME, LNAME, COMPANY, ADDR1, ADDR2, CITY, STATE, ZIP, PHONE, NONCONFORMING_FLAG, UNMAPPED_U2FIELD) AS SELECT UPPER(LNAME), CUSTOMER.ID, CUSTOMER.SAL, CUSTOMER.FNAME, CUSTOMER.LNAME, CUSTOMER.COMPANY, CUSTOMER.ADDR1, CUSTOMER.ADDR2, CUSTOMER.CITY, CUSTOMER.STATE, CUSTOMER.ZIP, CUSTOMER.PHONE,

Page 55: Version DEC2015 Schema Manager - Rocket Software...IBM DB2, or Microsoft SQL Server. Use this replicated database for data mining or reporting while you Use this replicated database

Working with U2 virtual fields against SQL Server 2008

55

CUSTOMER.NONCONFORMING_FLAG,CUSTOMER.UNMAPPED_U2FIELDFROMCUSTOMER.CUSTOMERCUSTOMER

Adding the UPCASE.LNAME virtual field to the schema map

To update the schema map, add the UPCASE.LNAME virtual field to the CUSTOMER schema map. TheUPCASE.LNAME virtual field will change the case of the last name to upper case using a newly createdSQL Server CUSTOMER.XUPPERCASE function. The type field is defined as SCALAR.

The following sample code demonstrates how to create a new CUSTOMER.XUPPERCASE function onSQL Server 2008:

CREATE FUNCTION CUSTOMER.XUPPERCASE(@LNAME VARCHAR(30))RETURNS varchar(30)BEGIN RETURN (UPPER(@LNAME))END

The following sample code demonstrates the SQL syntax on the EDA Schema Manager tool:

CREATE VIEW CUSTOMER.CUSTOMER_V( UPCASE_LNAME, ID, SAL, FNAME, LNAME, COMPANY, ADDR1, ADDR2, CITY, STATE, ZIP, PHONE, NONCONFORMING_FLAG, UNMAPPED_U2FIELD) AS SELECT CUSTOMER.XUPPERCASE(CUSTOMER.LNAME), CUSTOMER.ID, CUSTOMER.SAL, CUSTOMER.FNAME, CUSTOMER.LNAME, CUSTOMER.COMPANY, CUSTOMER.ADDR1, CUSTOMER.ADDR2, CUSTOMER.CITY, CUSTOMER.STATE, CUSTOMER.ZIP, CUSTOMER.PHONE,CUSTOMER.NONCONFORMING_FLAG, CUSTOMER.UNMAPPED_U2FIELD FROM CUSTOMER.CUSTOMER CUSTOMER

Adding the DESCRIPTION virtual field to the schema map

To update the schema map, add the DESCRIPTION virtual field to the CUSTOMER schema map. TheDESCRIPTION virtual field will retrieve the description information from the PRODUCTS.PRODUCTStable using the TRANS function. The type field is defined as TRANS.

Note: The PRODUCTS.PRODUCTS table must first be created on SQL Server 2008, before you use theTRANS function.

The DESCRIPTION field is a multivalue virtual field that is part of CUSTOMER.ORDERS_MV_V view.

The following sample code demonstrates the SQL syntax:

CREATE VIEW CUSTOMER.ORDERS_MV_V(ID, ORDERS_MV_POS, DESCRIPTION, PRODID, SER_NUM, PRICE, BUY_DATE, PAID_DATE, SVC_PRICE, SVC_START, SVC_END, SVC_PAID_DATE)AS SELECT ORDERS_MV.ID, ORDERS_MV.ORDERS_MV_POS, VA2.DESCRIPTION, ORDERS_MV.PRODID, ORDERS_MV.SER_NUM, ORDERS_MV.PRICE, ORDERS_MV.BUY_DATE, ORDERS_MV.PAID_DATE, ORDERS_MV.SVC_PRICE, ORDERS_MV.SVC_START, ORDERS_MV.SVC_END, ORDERS_MV.SVC_PAID_DATE FROM CUSTOMER.ORDERS_MV ORDERS_MV LEFT OUTER JOIN PRODUCTS.PRODUCTS VA2 ON ORDERS_MV.PRODID = VA2.ID

After the CUSTOMER.ORDERS_MV_V view is created, it can be accessed on SQL Server 2008.