29
Fri, Nov
0 New Articles

An Introductin to Distributed Data Management

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Brief: If you're looking for a simple, transparent way to access a remote database on an AS/400, IBM has a way for you to locate, retrieve and present the remote data virtually automatically, with distributed data management (DDM).

MIS shops that support multiple AS/400s are becoming more and more prevalent. Your AS/400s may be in the same room or at remote locations around the world; in either case, there may be occasions when you need to access data on one system using a program on another system. Imagine for example, that your company, located in Carlsbad, California, has just purchased a competitor located in Loveland, Colorado. Everyone from the CEO to the janitor is smiling-except you and your MIS team.

You are faced with the challenge of getting inventory information from one system to the other. Somebody suggests using Distributed Data Management (DDM) and soon a chorus of voices agrees that DDM might be just what you need. You're left with two questions: "What is DDM?" and "How can it help me?"

What is DDM?

DDM is part of OS/400. It permits applications or users on an AS/400 to access database files that exist on a remote system, with little or no RPG program modification. Access to remote files is transparent to the user except for the time required to establish a communications link between the two systems. (The systems may include AS/400s, S/36s, S/38s or other DDM-compatible systems.) For our example, we'll simplify things by having an inventory-inquiry program on the AS/400 in Carlsbad access a single inventory file on the AS/400 in Loveland. You can expand these concepts to access multiple programs and database files on the remote system and to allow two-way communication so that Loveland users can access the Carlsbad inventory.

I'll presume that you have established a point-to-point SDLC connection using Advanced Program-to-Program Communications (APPC). Establishing the connection is beyond the scope of this article, but I've included a reference list if you need more information on these topics. DDM connections are limited to either APPC (as we're using in this example) or Advanced Peer-to-Peer Networking (APPN).

There are three basic components of DDM that facilitate remote file processing: DDM files, Source DDM (SDDM) and Target DDM (TDDM). A DDM file contains information about how to find a database file on the remote system. When your RPG or CL program accesses a DDM file which points to a database file on the remote system, it triggers the entire DDM process. A DDM session is established between SDDM on the local AS/400 and TDDM on the target AS/400. The DDM session, SDDM and TDDM are all transparent to the user and the applications programmer, but they are necessary to pass the appropriate data to the program. We'll look at these elements in more detail in the following sections.

DDM Files

To access the inventory file on the Loveland system, you must create a DDM file on the Carlsbad system. DDM files are not database files accessible by programs! It might be helpful to think of a DDM file as a special type of access path: when a program on the source system (Carlsbad) accesses a DDM file, it is directed to the database file on the target system (Loveland). For each file in Loveland that you need to access, you'll need a DDM file on the Carlsbad system.

Before you can create a DDM file, you need some information about both the Loveland system and the Carlsbad system. You'll need to know the local location name for both systems and the local network ID and default mode for Loveland. Run the Display Network Attributes (DSPNETA) command (1) to get this information. Next you'll run the Create DDM File (CRTDDMF) command (2) in Carlsbad to define your DDM file for the inventory file in Loveland.

Before you can create a DDM file, you need some information about both the Loveland system and the Carlsbad system. You'll need to know the local location name for both systems and the local network ID and default mode for Loveland. Run the Display Network Attributes (DSPNETA) command (Figure 1) to get this information. Next you'll run the Create DDM File (CRTDDMF) command (Figure 2) in Carlsbad to define your DDM file for the inventory file in Loveland.

CRTDDMF has many parameters, most of which can be defaulted. But there are seven key DDM values that present valuable options you need to be aware of, so we'll cover them here. DDM has a wider variety of capabilities than I'll discuss in this article-you may need to modify additional parameters if you use these other features. For a comprehensive look at all of DDM's capabilities see the DDM Guide listed in the references section at the conclusion of this article. An important thing to keep in mind at all times is that DDM file information is based on locations, so the parameters that specify where database files are located are critical elements of the DDM file. Of the seven parameters we'll discuss, four deal directly with location.

1. Use the FILE parameter to specify a file name and library to store the DDM file on the Carlsbad system.

2. The remote file (RMTFILE) parameter points to the database file name and library on the Loveland system (e.g., NEWINV/INVTOT).

3. The remote location name (RMTLOCNAME) should match the local location from DSPNETA on the Loveland AS/400. Figures 1 and 2 show the relationship between DSPNETA parameters in Loveland and CRTDDMF in Carlsbad.

The next four parameters can all be defaulted, but you may need to specify them, depending on the complexity of your communications network.

4. The remote location can be further qualified with the remote network identifiers (RMTNETID) parameter (default *LOC). Two locations with the same remote location name but different remote network identifiers are two separate locations just as two files with the same name in different libraries are separate files. If you use the RMTNETID parameter, it should match the local network identifier from your Loveland DSPNETA command.

5. The DEV parameter specifies the name of the APPC device description on the source system that's used with this DDM file. You should default this parameter to *LOC for most applications. By taking the *LOC default, OS/400 will automatically select the appropriate APPC device associated with the remote location. If no APPC device description exists, OS/400 will build one.

6. The local location name (LCLLOCNAME) parameter (default *LOC) specifies the Carlsbad system and must match the default local location name on the Carlsbad DSPNETA command, unless you have multiple local locations defined. In that case, you may insert the local location name you desire.

7. The last DDM file parameter we will look at is MODE (default *NETATR), which refers to the mode name to be used in conjunction with the remote location name to establish a communication link. Either take the *NETATR default, which will get the MODE specified in the Carlsbad AS/400 network attributes, or specify a mode. As with local location name, this depends on the complexity of your particular AS/400 network environment. If you're not sure which local location name or which mode to use, ask your networking specialist.

For our example, we'll create a DDM file named RMTINV in library INVLIB on the Carlsbad system. It points to the inventory file in Loveland (INVTOT in NEWINV library). We'll use the RMTLOCNAME of LOVELAND. The CRT-DDMF command looks like this:

 CRTDDMF FILE(INVLIB/RMTINV) + RMTFILE (NEWINV/INVTOT) + RMTLOCNAME(LOVELAND) + TEXT('DDM FOR REMOTE + INVENTORY FILE') 

Once you've created your DDM files, you can use several commands to maintain them. I recommend using Work with DDM Files (WRK-DDMF) since it will allow you to create, change, display or delete DDM files easily.

Go to the Source

Unlike the DDM file, neither SDDM or TDDM require any input from you. These two elements establish the conversation between the Carlsbad system and the Loveland system. When a program on the Carlsbad AS/400 accesses a file, OS/400 looks for it within the Carlsbad database. In our example, a DDM file in Carlsbad points toward Loveland. At this point, the Carlsbad system will decide whether or not to start SDDM on the Carlsbad AS/400. It checks to see if an SDDM session for this job already exists, whether it's to Loveland or the Moon. If an SDDM session exists, it will be used. Otherwise, the Carlsbad system will start an SDDM session for the job. No matter how many DDM conversations are active or how many DDM files are open for a job, there will only be one SDDM session. You can find evidence of the SDDM session by using the Work with Configuration Status (WRKCFGSTS) command on the source system. Specify the line description that connects the source and target system for the configuration description (CFGD) parameter. You'll find an active job under that line.

In turn, SDDM checks to see if a DDM conversation to the remote system exists for this job. SDDM uses the remote location name and mode parameters in the DDM file to locate the correct system-for this part of the connection, Loveland and the Moon require separate conversations. If a DDM conversation exists for this job, SDDM will use it. If, however, a conversation for this job doesn't exist, SDDM sends a request to the Loveland system to start a TDDM job to establish the DDM conversation. Once the DDM conversation is active, SDDM and TDDM automatically handle the data interaction between systems. The entire process required to activate a DDM session is transparent to the user and occurs automatically.

Eyes on Target

Once the DDM conversation is established, TDDM is an active batch job on the Loveland system. You can find evidence of this job the same way you did for the SDDM job mentioned earlier (use the WRKCFGSTS command for the line description connecting the systems). You will find an active job for TDDM. It waits for instructions from SDDM and passes the request to database (or folder) management. For example, if a program in Carlsbad opens a DDM file, TDDM locates the file and passes on the request to open it. The result of the operation (in this case, a successful or unsuccessful file open) is returned to TDDM which, in turn, forwards it through the DDM connection to SDDM. SDDM forwards the information to the requesting application in Carlsbad and magically your program has opened the remote file.

Now let's talk about ending a DDM conversation. This is controlled by the DDM Conversation (DDMCNV) attribute of the Change Job (CHGJOB) command of the job in Carlsbad. The default for DDMCNV is *KEEP, which means that the DDM conversation will remain active until the job ends, or until a communications failure occurs. When using *KEEP, you may also use the Reclaim DDM Conversation (RCLDDMCNV), or the Reclaim Resource (RCLRSC) commands to explicitly terminate the DDM conversations.

You can override the default of DDMCNV to *DROP, using the CHGJOB command, which will terminate the DDM conversation automatically when all DDM files are closed and all file locks on the remote DDM file are removed (usually when the program ends). The key thing to remember about choosing between *DROP and *KEEP is the system overhead associated with keeping or restarting a DDM session.

If you think DDM will run multiple times throughout the day, *KEEP will save the system time and resources needed to start a DDM conversation.

On the other hand, specifying *DROP will free up the communications resources used by DDM.

What About the Application Programs?

We've got the basics of DDM plumbing sorted out, and it seems almost too easy to be true. But what about the application programs? What do we need to do to the RPG and CL programs in Carlsbad to display the Loveland inventory data? These modifications are surprisingly simple. A DDM file name can be used alomost anywhere a database file name can be used. If you externally define the DDM file which points to the Loveland inventory file in an RPG program, the DDS is automatically retrieved from the Loveland system. An even simpler solution is available for our example. The Loveland inventory file definition matches the Carlsbad inventory file so you can simply create a copy of the CL for the Carlsbad inventory inquiry. Insert an Override Database File (OVRDBF) command to point to the DDM file instead of the Carlsbad database file-DDM does the rest!

DDM files can also be specified in the Create RPG Program (CRTRPGPGM) command in the SRCFILE or PRTFILE parameters. When you specify a DDM file for SRCFILE, DDM automatically retrieves RPG specifications from the target system. If you use a DDM file for PRTFILE, a compiled program listing is stored in the specified database file on the target system.

Back to the Top

Now that we have the basic concepts of DDM laid out, let's review our example. Your mission is to attach a new option to the inventory inquiry menu which gives users access to the inventory in the Loveland location. To accomplish this goal, you'll need to :

1. Establish a communications link between the two systems.

2. Create a DDM file in Carlsbad that points to the Loveland inventory file.

3. Clone your existing inventory inquiry application and make it point to the Loveland inventory file.

When your users want to know the inventory in the Loveland location, all they have to do is select the new menu option. The CL behind this menu option uses an OVRDBF command to point to the DDM file (RMTINV) in Carlsbad, which in turn points across the communications line to the inventory file (INVTOT) in Loveland. SDDM and TDDM will be busily exchanging data and the Loveland inventory will appear on the screens of your Carlsbad users.

DDM offers an elegantly simple way to access data on a remote system. Its performance is not the greatest, but its flexibility, simplicity and transparent user interface make DDM a tool you should take advantage of.

You and your MIS team will be doing lots of smiling when your boss asks how you managed to accomplish this task so fast. Just smile at him and say, "It's DDM Magic."

Kris Neely is the connectivity editor for Midrange Computing.

References

APPC Programmers Guide (SC41-8189) APPN Guide (SC41-8188) Communications Management Guide (SC41-0024) Distributed Data Management Guide (SC41-9600)


An Introductin to Distributed Data Management

Figure 1 The Display Network Attributes Screen

 Display Network Attributes System: MC Current system name . . . . . . . . . . . . . . : MC Pending system name . . . . . . . . . . . . . : Local network ID . . . . . . . . . . . . . . . . : APPN Local control point name . . . . . . . . . . . . : LOVELAND Default local location . . . . . . . . . . . . . : LOVELAND Default mode . . . . . . . . . . . . . . . . . . : LU62 APPN node type . . . . . . . . . . . . . . . . . : *NETNODE Maximum number of intermediate sessions . . . . : 200 Route addition resistance . . . . . . . . . . . : 128 Server network ID/control point name . . . . . . : *LCLNETID *ANY More... Press Enter to continue. F3=Exit F12=Cancel 
An Introductin to Distributed Data Management

Figure 2 The Create DDM File Command

 Create DDM File (CRTDDMF) Type choices, press Enter. DDM file . . . . . . . . . . . . FILE > RMTINV Library . . . . . . . . . . . > INVLIB Remote file: RMTFILE File . . . . . . . . . . . . . > INVTOT Library . . . . . . . . . . > NEWINV Nonstandard file 'name' . . . _______________________________ ______________________________________________________________________________ ______________________________________________________________________________ _________________________________________________________________ Remote location . . . . . . . . RMTLOCNAME > LOVELAND Text 'description' . . . . . . . TEXT > 'DDM FOR REMOTE INVENTORY FILE' ___________________ Additional Parameters Device: DEV APPC device description . . . *LOC Local location . . . . . . . . . LCLLOCNAME *LOC Mode . . . . . . . . . . . . . . MODE *NETATR Remote network identifier . . . RMTNETID *LOC Access Method: ACCMTH Remote file attribute . . . . *RMTFILE Local access method . . . . . ___________ Share open data path . . . . . . SHARE *NO_ Record format level check . . . LVLCHK *RMTFILE Authority . . . . . . . . . . . AUT *LIBCRTAUT Replace file . . . . . . . . . . REPLACE *YES Bottom F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: