The aim of this session is for you to:
You will use the System Verification Program, SVPCPRB, through out this session. As a bonus to this session, we aim to show you that the SVPCPRB will assist you in determining the cause of a problem.
This sessions uses the LANDP configuration that you customized during the customization session.
From the command prompt C:\LDP, load LANDP by entering the command AUTOFBSS. When you successfully load LANDP start the SVPCPRB utility from the C:\LDP prompt. SVPCPRB is named slightly differently depending on the platform:
This Shared File Hands-On session uses the Shared File configuration that is used in the Installation and Customization Hands-On.
Register this instance of SVPCPRB with the supervisor, SPV, by issuing the IN function to the SPV server.
Now, you need to enter some data into the Shared File Server. To do this you need to open the Shared File Server and a transaction, issue the sequence of LANDP functions:
Where ## is the Shared File Server Prefix for your workstation.
The record format that the we defined is:
Use the Program Control Block (PCB) 'ACCNAME' and the insert (IS) function to input some records using the format described above. You need to make a note of the data as you will need it later on.
You will now add some more records, but using a different PCB. Use the PCB 'ACCNUMB.' Although, we are using a different PCB the record format remains the same. Again, you need to make a note of the data as you will need it later on.
Once you added records to the database, you need to commit these changes and end the transaction. You can do this by issuing the ET and CO functions to the Shared File Server.
In this exercise we will find a particular record and then replace it (update it) with another one. First of all, you need to open a transaction with the Shared File Server. Issue an Open Online and Begin Transaction function to open the transaction. Now, you will use the Hold Unique (HU) function, defined below, to find and lock a particular record.
When you issue the HU function, you request the Shared File Server to find a record whose 'ACCNUMB' field equals the account number you gave in the Request Data Area.
After the Shared File Server returns the data, you can update or correct the record. After the Shared File Server returns the data, you can update or correct the record. Copy the data from the Reply Data Area to the Request Data Area, in SVPCPRBN you do this by clicking the REP->REQ button and in SVPCPRB and svpcprbl you do this by pressing the F7 key. Once you have copied the data from the Reply Data Area to the Request Data Area change the account number and set the Function, Request Data Length and Request Parameter Area as below. Send the request to the Shared File Server.
Does this function work ? What is the server return code ? Check the meaning of it in the LANDP Problem Determination manual.
Because we customized the ACCNUMB field as a primary key, the value can not change. Therefore, the only way for you to update the record is to delete it first. You must retrieve the record using a Hold or Keep function in order to delete the record. (Unless you have locked the whole database). Since you issued a HU function as a previous function to the Shared File Server within this transaction, you will only need to issue a Delete(DL) function to delete the record. Do not delete the data held in the Request Data Area. Issue the DL function as defined below.
You have now deleted this record and the Shared File Server will return the space it occupied to the free chain of records when the next CP or ET is issued.
Now, you deleted the original record, you can insert updated/corrected. Modify the data in the Request Data Area, as required, and then use insert (IS) function to add the record to the database.
You have now replaced the original record with your updated/corrected one. You must now commit the changes and close the transaction issue an ET and then a CO function.
In this exercise we look at retrieving the status of a Shared File. Two Shared File server functions exist that give information about the status of a file, the Read Header (RH) function and the Statistic Request (SR) function.
The Read Header function provides information about the characteristics of a file associated with a PCB name. You must first issue an OO function, followed by the RH function which is shown below.
The format of the data returned in Reply Data Area is:
(Next group of bytes are general DBD information)
(Next group of bytes are related PCB key information)
(Repeated for each segment)
103 Null value, 104 Reserved.
Initially, you will see this data as ASCII characters, use the Hex button (SVPCPRBN) or F6 key (other SVPCPRB versions) to display it as hex numbers. How many records are used in the data file? Does this match with the number of insert (IS) functions you have issued? (count only those with RC=OK).
The Statistic Request Function
The Statistic Request (SR) function returns information about the requests received for all or a single workstation. To request information about a single workstations you must enter the workstation ID in the Request Data Area and set the Request Data Length to 2. If the Request Data Length is zero then the information return is based on all workstations. Issue the SR function as defined below.
The format of the Reply Data Area bytes are:
Initially, you will see this data as ASCII characters, use the Hex button (SVPCPRBN) or F6 key (other SVPCPRB versions) to display it as hex numbers.
You can remove the entire contents of a file without deleting each record individually by using just 2 function calls. The first function holds the database for exclusive use of the session, then the second function erases the data. To use these functions a current transaction must be open. Open a transaction using the BT function, you may also need to issue a GF and/or an OO function.
To request exclusive use of a Shared File you need to issue the EX function. The EX function obtains the exclusive use on the file associated with the PCB name given in the Request Parameter Area. In the example below we are using the ACCNUMB PCB, you can choose a PCB that is associated to the shared file that you wish to erase.
If the request was successful, you now own exclusive use of the shared file, i.e. it is locked at file level. Once you hold the file exclusively you can erase the contents by issuing the Erase Shared File Data function (ZD), see below. Once erased the data can not be recovered. Please note, that you will not be able to Rollback (RB) the Shared File after issuing a ZD.