Lesson 1.2: Add the performAction function to the PDS RAM to correspond with the custom HowTo action

In the last lesson, you configured the Sample PDS RAM with a HowTo custom action and its four parameters. In this lesson, you create or modify the function on the host that handles the HowTo action.

About this task

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 that is provided for the HowTo action id on the Sample PDS RAM does nothing.

Procedure

  1. Open the C file on the host containing the Sample PDS RAM source; it should be FEL.SFELSAMP(CRASPDS). You can open this file directly in Developer for z/OS®.
  2. If you have custom actions that are already implemented on the Sample PDS RAM, you 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.
  3. 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).
  4. 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 more custom actions to the PDS RAM later, you will want to specify for each custom action id what action should be performed, similar to the snippet of code in step 2.
  5. Save the source and debug any errors.