The LANDP Electronic Journal Server provides a convenient way of storing the data of all transactions in a LANDP workgroup during a chosen business period, such as a day or a week. An example would be to use an Electronic Journal server to store the customer transactions made by each teller per day.
During this tutorial, you will customize a simple LANDP workgroup consisting of a workstation providing an electronic journal service. You will also gain experience in using the Electronic Journal data management functions.
In this section the LANDP configuration files are written to specify a LANDP workstation that provides the Electronic Journal service.
The Electronic Journal profile we wish to create will store records corresponding to an account transaction. A workstation that uses an Electronic Journal server must also have access to a System Manager server for validating record formats, a Shared File Server for storing the journal data, and a Shared File Query server for performing search operations. For information on general requirements of LANDP services, see page 51 of the LANDP Installation and Customization manual.
An introduction to creating LANDP common definitions is available here.
First we must define the record format for the Electronic Journal. Since we are also customizing a Shared File Server, we must specify an additional record format, even though we will not be using it. The following vectors specify the record format for the Shared File Server. Click the vector names for further information.
RECDEF |
NAME=LDPREC01, DELIMIT='/', DECSEP=',' |
RECFIELD  |
NAME=NAMES, LENGTH=20, FORMAT=C |
RECFIELD |
NAME=NUMBP, LENGTH=12, FORMAT=N |
RECFIELD |
NAME=BALS, LENGTH=12, FORMAT=P |
Now try to write a record definition for the Electronic Journal called JOUREC. The Electronic Journal record needs 3 fields, as follows:
ACCNUM Text, 20 Characters |
WSID Text, 2 Characters |
BAL Numerical Text, 12 Characters |
Add your own 4 vectors to specify JOUREC, the Electronic Journal record.
The following vectors specify a Shared File Server profile, using the Shared File record format defined above. The Electronic Journal server uses it's own profile, but this step is still necessary to configure the Shared File Server.
Add the following lines to the COMMON.SPC
SHFLDBD  |
SHFLPRF=LDPDATA, DBDNAME=LDPDBD, RECNAME=LDPREC01, KEY01=(NUMBP,P,N,,), KEY02=(NAMES,S,N,,), KEY03=(BALS,S,N,,), DBDPATH=C:\LDP\SHFL\, DBFLNAME=LDPDATA |
A Shared File PCB is used to access Shared File records. A PCB is normally associated with a key on the database, and allows you to search the database and iterate over the results one record at a time. Each PCB remembers it's current position in the database.
Add the following lines to the COMMON.SPC
SHFLPCB  |
PCBNAME=ACCNUMB, KEYFIELD=NUMBP |
SHFLPCB |
PCBNAME=ACCNAME, KEYFIELD=NAMES |
SHFLPCB |
PCBNAME=BALANCE, KEYFIELD=BALS |
The Electronic Journal profile vectors essentially configure the location of the electronic journal files and the record formats to use for the journal.
Add the following lines to the COMMON.SPC
EJOUPRF  |
NAME=EJLDPS1, SHFLPRF=LDPDATA, DBDPATH=C:\LDP\JOURNALS\, SPLIT=128 |
EJOUREC | RECNAME=JOUREC |
The Electronic Journal server requires the System Manager server to be configured, as this provides some record verification facilities. The following is the most basic System Manager configuration, using all of the defaults.
Add the following lines to the COMMON.SPC
SMGRPRF | NAME=LDPSMGR |
SMGRUSER  |
USERID=LDPUSER, PASSWORD=LDPUSER |
The SOFTPACK vectors allow you to distribute your own software to each workstation along with the LANDP files. We will distribute files for the SVPCPRBN utility for our workstation.
Add the following lines to the COMMON.SPC
SOFTPACK  |
PACKNAME=CONFTEST, FILENAME=EHCXLATE.DLL, |
SOFTPACK  |
PACKNAME=CONFTEST, FILENAME=SVPCPRBN.EXE, |
SOFTPACK  |
PACKNAME=CONFTEST, FILENAME=SVPCPRBN.HLP, |
Save the file.
Some information on creating LANDP workgroup definitions is available here.
We will specify a single workstation providing an electronic journal service in a workgroup called "EJOU". We will also specify that the workstation will be used as a client for the electronic journal server.
LANCONF  |
NAME=EJOU, WSNAMES=(W1) |
LWSCONF |
NAME=W1, TYPE=NT, SERVER=SMGR, SERVER=SFQUERY, SERVER=SHFILE01, SERVER=ELECJO01, PAR&SHFL=(LDPDATA,,3), PAR&EJOU=(EJLDPS1), CLIENT=(SHFILE01,W1), CLIENT=(ELECJO01,W1), SOFTPACK=CONFTEST |
The COMMON.SPC and LANCONF.SPC must now be validated to ensure they have been entered correcly. For more information about the validation stage see page 55 of the LANDP Installation and Customization manual.
C:\
CD C:\EHC\EHCCUS\
VALSPEC COMMON
VALSPEC LAN \EJOU
Once the configuration has been validated, the LANDP files to be installed on each workstation can now be generated and copied. This is the distribution stage.
GENRUN \EJOU
GETTING \EJOU WS=W1 C:\EJOU\
The LANDP files are now installed in the directory C:\EJOU\.
The final stage is to start the LANDP services on the workstations.
CD \EJOU
SET LOGPATH=.
GENLOG
AUTOFBSS
The LANDP services should now have started. To view a list of the running LANDP services, type EHCINFO at the command prompt. You are now ready to begin using the LANDP Electronic Journal support.
Testing of LANDP servers is done using the SVPCPRB program. For more information on the SVPCPRB program and it's capabilities, see page 107 of the LANDP Programming Guide.
Communication with LANDP services is done by sending CPRB messages. The first message we must send is an IN command to the LANDP Supervisor server.
If the CPRB message was recieved successfully, the Server Return Code shown in the Output panel should read "OK". If the return code is different, refer to the Problem Determination manual for more information.
The LANDP Electronic Journal server can operate using either a physical or logical journal environment. In a physical journal environment, each journal uses one journal file or dataset on the electronic journal server.
To use a physical journal, you must first allocate one. During customization, we left the SEPSESS flag in the EJOUPRF vector as the default NO, meaning we must set up the transactions on the Shared File server ourselves. The Electronic Journal server uses the Shared File server to store its data.
Send a Grant function to the Shared File server to allow access to the shared file server as follows. Be sure to include the capital letter "O" in the request data area.
Next, open the Shared File server in online mode as follows:
The Shared File server can take a second or two to come online. A client application that uses the Electronic Journal server would use the TI function of the Electronic Journal server in a loop here to ensure the server is ready before continuing.
We can now allocate a physical journal called JOURNAL1 using the AL function of the Electronic Journal server. Remember to change the server name to ELECJO01. The position of the text in the Request Parameter area is also important. Be sure to place the journal name at offset 10.
Once a physical journal has been allocated, you can now add a record to it. Begin a transaction using the BT function of the Shared File server as follows:
The record format that we are going to use is JOUREC, which was specified at customization. This format has 3 fields per record, a textual account number, a textual workstation identifier, and a numerical balance. Add a record to the physical journal as follows:
Retrieving a record from the journal is done as follows. The following command will retrieve the record added previously for viewing by matching the first record with the same balance value. See page 398 of the LANDP Programming Reference for a detailed description of the search parameters you can use.
The result of the search will appear in the Reply Data Area. Once you have completed a transaction, issue an end transaction request to the Shared File server as follows:
Once you have finished with a physical journal, you should release it. Release the physical journal as follows:
The RS command resets all journals that have been released, or can force-reset a physical journal. To reset all released journals, allowing them to be reallocated, issue an RS command as follows:
To end this Electronic Journal session, you must close the connection to the Shared File server. Issue a CO to close the online Shared File session:
Finally, issue a RF to revoke your access to the Shared File server as follows:
When you have completely finished with LANDP, you should send an EJ message to the Supervisor server to disconnect your client from the LANDP system.