In the last lesson, you configured the Sample PDS RAM with
a HowTo custom action and its four parameters. In this lesson, you
will create or modify the function on the host that will handle the
HowTo action.
The HowTo action was created for demonstrational purposes
to display the dialog box to which you will later apply the actionValidators, parameterValidators,
and customParameterControl extension points. However,
for the purposes of this sample, you do not need this action to perform
any action on the host. Therefore, the function provided for the HowTo
action id on the Sample PDS RAM will do nothing.
- Open the C file on the host containing the Sample PDS RAM
source; it should be FEK.SFEKSAMP(CRASPDS). You can
open this file directly in Rational® Developer
for System z®.
- If you have custom actions already implemented on the Sample
PDS RAM, you will want to modify the performAction function
to do nothing if it is passed the HowTo action id and return successful.
Use the following sample code snippet to add this to your performAction function:
if(actionID == 100)
{
return 0;
}
If the HowTo custom action calls the performAction function
it will now return successful without performing any action on the
host. Skip steps 3 and 4.Note: If you have already implemented the performAction function,
you should check and make sure that the actionId 100
has not already been set to another custom action.
- If you have not implemented any custom actions for the
Sample PDS RAM, you will want to implement the performAction function
and have it do the same thing as the snippet of code above does. Start by adding the following export statement to the preprocessor
directives at the top of the C source: #pragma export(performAction).
- Next, add the following method to the PDS RAM:
int performAction(int actionID,
char instanceID[256],
char memberID[256],
void** params,
void** customReturn,
char error[256])
{
/*Accept any actionID and return successfully*/
return 0;
}
Note: If you add additional custom actions to the PDS
RAM at a later time you will want to specify for each custom action
id what action should be performed, similar to the snippet of code
in step 2.
- Save the source and debug any errors.