Validate Parmlib Syntax

You can use this operation to drive automatic syntax validation of most z/OS parmlib members.

HTTP method and URI path

PUT /zosmf/parmlib/<version>/<membertype>/validate
Announcement:
  1. This API checks the parmlib syntax, such as keyword misspellings and missing required fields. For more information about the correct syntax for each parmlib, see the “Syntax format” section for each parmlib in Members of SYS1.PARMLIB in z/OS MVS Initialization and Tuning Reference. The syntax standards are strict. For instance, an extra space might be regarded as a syntax error.
  2. This API does not validate the parmlib field value. For instance, if the value of a parmlib field is a variable and the variable range is 1 to 100, this API does not check whether the value is between 1 and 100.
  3. The API does not include a correlation check of the parmlib field value. For instance, if a condition exists that field A cannot be set when field B is set, the API does not check whether both field A and field B are set at the same time.
  4. This API can take tens of seconds to complete if there is a large amount of data to validate.
Where:
<version>
Is the URI path variable that identifies the version of the z/OS parmlib member syntax validation service.
The following value is valid: v1.
<membertype>
Is the URI path variable that identifies the member type of the z/OS parmlib member syntax validation service. For example, BPXPRM is the member type for BPXPRM01.
The value must be uppercase.
Required.
Start of change<system>End of change
Start of changeIs the URI parameter that identifies the remote system name. This remote system must be in the same sysplex and share DASD with the current system. End of change
Start of changeOptional.End of change
Start of change<deep>End of change
Start of changeIs the URI parameter that identifies whether you need to validate all the members of all the parmlib member types from LOAD. End of change
Start of changeThe variable type is boolean, and the default value is false. The value can be true only when the <membertype> is LOAD.End of change
Start of changeOptional.End of change
Start of change<member>End of change
Start of changeIs the URI parameter that identifies a member name. For example, LOAD01.
  • If the <member> variable is not used, <dataset> and <volser> also cannot be used.
  • If the <member> variable is used, <dataset> is required. If the <dataset> is not cataloged, <volser> is required. If the <dataset> is cataloged, <volser> is ignored.
Optional.End of change
Start of change<dataset>End of change
Start of changeIs the URI parameter that identifies a PDS data set name. For example, SYS0.IPLPARM is where the <member> is located.End of change
Start of changeOptional.End of change
Start of change<volser>End of change
Start of changeIs the URI path variable that identifies volume information for <dataset>.End of change
Start of changeOptional.End of change
Start of change<memLOAD>End of change
Start of changeIs the URI parameter that identifies a member name of LOAD. For example, LOAD01.
  • If <memLOAD> is not used, then <dsnLOAD> and <volsLOAD> also cannot be used.
  • If <memLOAD> is used, <dsnLOAD> is required. If <dsnLOAD> is not cataloged, <volsLOAD> is required. If <dsnLOAD> is cataloged, <volsLOAD> is ignored.
Optional. End of change
Start of change<dsnLOAD>End of change
Start of changeIs the URI parameter that identifies a PDS data set name. For example, SYS0.IPLPARM is where <memLOAD> is defined. End of change
Start of changeOptional.End of change
Start of change<volsLOAD>End of change
Start of changeIs the URI parameter that identifies the volume information for <dsnLOAD>.End of change
Start of changeOptional. End of change

Scenarios

What does this do
Scenario 1
Validate all IEASYM and IEASYS members that are referenced by the LOAD member and all members for all member types that are referenced by IEASYS members.
For example, zosmf/parmlib/v1/LOAD/validate? deep=true & [memLOAD=name] & [dsnLOAD=name].
Scenario 2
Validate the syntax of all active members of the specified parmlib member type.
For example, zosmf/parmlib/v1/<membertype>/validate? [memLOAD=name] & [dsnLOAD=name].
Scenario 3
Validate the syntax of a specific member of a parmlib member type.
Scenario 3-1
Validate the syntax of a specific member of a parmlib member type.
For example, zosmf/parmlib/v1/<membertype>/validate? {member=name} & {dataset=name} & [volser=name].
Scenario 3-2
Validate the syntax of a member with content in the request body.
For example, zosmf/parmlib/v1/<membertype>/validate.

Request Body

The data to be validated. The data should be parmlib member content and match with <membertype>. For example, if the <membertype> is IZUPRM, the data should be IZUPRM parmlib content. Request body is used just for Scenario 3-2.

Start of change

Response Content

On successful completion, the service returns a response body, which contains a JSON object as described in Table 1 (by default). When an error occurred, reference to Table 9 and Table 10 for the description of the error response body.
Response for Scenario 1 and Scenario 2:
Table 1. Successful completion response content
Field name Type Description
result String The result of the validation. The value can either be set as success or failed.
numberOfMembers Integer Total number of validated members
numberOfFailedMembers Integer Total number of failed validated members.
parmlibDatasets JSONArray The dataset defined in the root LOAD parmlib by the PARMLIB statement. For more information, see Table 2

This field is only applicable for scenario 1 and 2.

details JSONObject The validation details of every member. For more information, see Table 3.

This field is only applicable in a scenario when validation failed.

Table 2. Fields of one JSONObject in parmlibDatasets JSONArray
Field name Type Description
volser String Volume serial of parmlib data set.
dataset String Dataset name.
Table 3. Fields of details
Field name Type Description
membertype name (for example, BPXPRMxx) JSONObject Field type is JSONObject only when there is not any member of the type referenced by LOAD. For more information, see Table 4
JSONArray Field type is JSONArray when there are one or more members of the type referenced by LOAD. When a parmlib member is empty or does not exist, for more information, see Table 5 for the description of the object contained in the array. Otherwise, for more information, see Table 6
Table 4. Fields of one JSONObject for one member type
Field name Type Description
warning String The warning message is about there is not any parmlib member of the type referenced by LOAD.
Table 5. Fields of one JSONObject for one member type when the parmlib member is empty or does not exist
Field name Type Description
member String Member name of validation.
dataset String Dataset of member of validation. The value is null if the parmlib member does not exist.
specifiedVia String Array The route found current Parmlib member. E.g., IEASYS01 was defined in SYS1.IPLPARM(IEASYM01) and IEASYM01 was defined in SYS1.IPLPARM(LOAD00), the specifiedVia of IEASYS01 will be ["SYS1.IPLPARM(LOAD00)","SYS1.IPLPARM(IEASYM01)"]
validationResult String The value is N/A when the parmlib member is empty or does not exist.
warning String The warning message is about that the parmlib member content is empty or this parmlib member does not exist.
Table 6. Fields of one JSONObject in details JSONArray when the parmlib member exists and is not empty:
Field name Type Description
member String Member name of validation.
dataset String Dataset of member of validation
specifiedVia String Array The route found current Parmlib member. E.g., IEASYS01 was defined in SYS1.IPLPARM(IEASYM01) and IEASYM01 was defined in SYS1.IPLPARM(LOAD00), the specifiedVia of IEASYS01 will be ["SYS1.IPLPARM(LOAD00)","SYS1.IPLPARM(IEASYM01)"]
validationResult String The validation result for one parmlib member. The value could only be success or failed.
Fields that exist only when the validation result includes failed cases
numOfFailure Integer Total failure number of one parmlib member validation.
failures JSONArray All failures happened in one parmlib member. This array provides one or more objects (For more information, see Table 7) each describing a failure which has occurred during validation for this parmlib member.
Table 7. Fields of failures:
Field name Type Description
index Integer The index of the current failure information.
location JSONObject The failure location. The JSONObject includes two fields - line and position, and both of them are Integer to locate where the error is.
currentField String The field where syntax validation fails.
expectedField String Array The expected field, which aligns with the syntax file.
afterField String The previous field in which syntax failed.
input String The field that holds the whole statement of failure.
message String The concatenation of information of the input field.

Response for Scenario 3:

For successful completion response content, reference Table 8. For error response content, such as when the parmlib member can not be found in Scenario 3-1, reference Table 10 and Table 11.
Table 8. Successful Completion Response Content
Field name Type Description
result String The validation passed or not. The value could only be success or failed.
numberOfMembers Integer Total number of validated members
numberOfFailedMembers Integer Total number of failed validated members.
details JSONObject The validation details of every member. (For more information, see Table 9)
Table 9. Fields of one JSONObject in details
Field name Type Description
member String Member name of validation. Only for Scenario 3-1.
dataset String Dataset of member of validation. Only for Scenario 3-1.
validationResult String The validation result for one parmlib member. The value can only be success or failed or N/A when the member is empty.
Fields exist only when validation result includes N/A cases:
warning String The warning message states the parmlib member content is empty.
Fields exist only when validation result includes failed cases:
numOfFailure Integer Total failure number of one parmlib member validation. This field is only applicable in a scenario when validation has failed.
failures JSONArray All failures happened in one parmlib member. This field is only applicable in a scenario when validation has failed. (For more information, see Table 7)
Table 10 and Table 11 describe the error response body.
Table 10. Error response body
Field name Type Description
errorData JSONObject Error information. For more information, see Table 11.
Table 11. errorData
Field name Type Description
reason String Error reason number
messages String Error message
End of change

HTTP status codes

On successful completion, the HTTP status code 200 (OK) is returned with a response body.

Table 12. HTTP status codes for successful completion
HTTP Status Codes Description
HTTP 200 OK but the validation result can be "success" or "failed".

Otherwise, the following HTTP status codes are returned for the indicated errors. The response body is a standard error response body that provides the reason code that is indicated and the associated error message.

Table 13. HTTP error status codes
HTTP error status code Description
HTTP 400 Bad request The request contains incorrect parameters.
HTTP 401 Unauthorized The request cannot be processed because the client is not authorized.
HTTP 403 Forbidden The submitter of the request did not authenticate to z/OSMF, or the server rejected the request.
HTTP 404 Not found The target of the request was not found.
HTTP 422 Unprocesable entity An error occurrs when you create an object.
HTTP 500 Internal server error The server encountered an error that prevented the completion of the request. See the response body for a JSON object with information about the error.
HTTP 503 Internal server error The service is currently not available to process the request.

Usage considerations

<member>&<dataset>&<volser> as a group, <memLOAD>&<dsnLOAD>&<volsLOAD> as a group, and the Request Body are mutually exclusive. If the Request Body is not empty, <member>&<dataset>&<volser> and <memLOAD>&<dsnLOAD>&<volsLOAD> are ignored. If both <member>&<dataset>&<volser> and <memLOAD>&<dsnLOAD>&<volsLOAD> are set, <memLOAD>&<dsnLOAD>&<volsLOAD> is ignored.

If you need to validate Parmlib syntax with this REST API, one of the following is suggested:
  1. If you need to validate syntax on only one specific parmlib content, put the parmlib content into the request body or set <member>&<dataset>&<volser> for the specific parmlib member.
  2. If you need to validate syntax on all of the members of one specified parmlib member type, use <memLOAD>&<dsnLOAD>&<volsLOAD>. The API analyzes the <memLOAD> member, finds out the specific members for this member type, and validates all of them. If <memLOAD>&<dsnLOAD>&<volsLOAD> is not set, the API analyzes the active LOADxx that is used in the current system. The data set that is used to save the LOADxx member must be cataloged.
  3. If you need to validate the syntax on all the members of the supported parmlib member types, set <membertype> to LOAD and <deep> to true. If <memLOAD>&<dsnLOAD>&<volsLOAD> were set, the API analyzes the <memLOAD> member, find out all the specific members for all the supported member types and validate them all. If <memLOAD>&<dsnLOAD>&<volsLOAD> are not set, the API analyzes the active LOADxx that is used in the current system. The data set that is used to save the LOADxx member must be cataloged.

Examples

  1. If you want to validate one ALLOC parmlib member content, one way is to put content directly into the request body:
    URI: 
    PUT /zosmf/parmlib/v1/ALLOC/validate
    Request body:
    TIOT SIZE(64)
    UNIT ERROR_FIELD NAME(SYSDA)
    VOLUME_MNT POLICY(WTOR)
    SPEC_WAIT       MAXNWAIT(10)
                    POLICY(WAITHOLD)
                    POLICYNW(WTOR)
    ALLC_OFFLN POLICY(WAITNOH)
                    MAXNWAIT(10)
                    POLICYNW(WTOR)
    
    In this example, we intentionally input an invalid field called “ERROR_FIELD”. The API found this error and this is the response:
    {
        "result": "failed",
        "numberOfMembers": 1,
        "numberOfFailedMembers": 1,
        "details": {
            "validationResult": "failed",
            "numOfFailure": 1,
            "failures": [
                {
                    "index": 1,
                    "location": {
                        "line": 2,
                        "position": 6
                    },
                    "currentField": "ERROR_FIELD",
                    "expectedField": [
                        "NAME"
                    ],
                    "afterField": "UNIT",
                    "input": "UNIT ERROR_FIELD NAME ( SYSDA ) ",
                    "message": "SYNTAX ERROR 1 START AT LINE 2, POSITION 6: \n CURRENT FIELD : ERROR_FIELD \n EXPECT NAME AFTER UNIT \n"
                }
            ]
        }
    }
    
    Another way to validate one specific parmlib member is to set <member>&<dataset> in the URI, and nothing else in the request body. For example:
    PUT /zosmf/parmlib/v1/ALLOC/validate?dataset=SYS1.PARMLIB&member=ALLOC01.
  2. If you want to validate one parmlib type , such as all members of CONSOL based LOADAC, which is in SYS1.PARMLIB, you can use this URI:
    /zosmf/parmlib/v1/CONSOL/validate?memLOAD=LOADAC&dsnLOAD=SYS1.PARMLIB
    The response is as follows:
    {
        "result": "failed",
        "numberOfMembers": 1,
        "numberOfFailedMembers": 1,
        "parmlibDatasets": [
            {
                "volser": "null",
                "dataset": "XESCT.PARMLIB"
            },
            {
                "volser": "null",
                "dataset": "SYS1.PARMLIB"
            },
            {
                "volser": "null",
                "dataset": "SYS1.PARMLIB.POK"
            },
            {
                "volser": "null",
                "dataset": "SYS1.PARMLIB.INSTALL"
            }
        ],
        "details": {
            "CONSOLxx": [
                {
                    "member": "CONSOLXI",
                    "dataset": "SYS1.PARMLIB",
                    "specifiedVia": [
                        "DEFAULT",
                        "SYS1.PARMLIB(IEASYS00)"
                    ],
                    "validationResult": "failed",
                    "numOfFailure": 2,
                    "failures": [
                        {
                            "index": 1,
                            "location": {
                                "line": 16,
                                "position": 23
                            },
                            "currentField": "ALTERNATE",
                            "expectedField": [
                                "INIT",
                                "HARDCOPY",
                                "CONSOLE",
                                "DEFAULT"
                            ],
                            "afterField": ")",
                            "input": "ALTERNATE ( 3D4 ) ROUTCODE ( ALL ) AREA ( 10 ) PFKTAB ( 12 ) RTME ( 1/4 ) RBUF ( 15 ) AUTH ( MASTER ) DEL ( R ) UNIT ( 3270-X ) MFORM ( S ) ",
                            "message": "SYNTAX ERROR 1 START AT LINE 16, POSITION 23 :\nCURRENT FIELD : ALTERNATE\n  EXPECT ONE OF THE FOLLOWINGS AFTER ) : \n    [INIT, HARDCOPY, CONSOLE, DEFAULT] \n"
                        },
                        {
                            "index": 2,
                            "location": {
                                "line": 22,
                                "position": 23
                            },
                            "currentField": "ALTERNATE",
                            "expectedField": [
                                "INIT",
                                "HARDCOPY",
                                "CONSOLE",
                                "DEFAULT"
                            ],
                            "afterField": ")",
                            "input": "ALTERNATE ( 3E0 ) ROUTCODE ( ALL ) AREA ( 14 ) PFKTAB ( 24 ) RBUF ( 15 ) AUTH ( ALL ) UNIT ( 3270-X ) MFORM ( S ) ",
                            "message": "SYNTAX ERROR 2 START AT LINE 22, POSITION 23 :\n CURRENT FIELD : ALTERNATE \n  EXPECT ONE OF THE FOLLOWINGS AFTER ) : \n    [INIT, HARDCOPY, CONSOLE, DEFAULT]\n"
                        }
                    ]
                }
            ]
        }
    }
    
  3. If you want to validate members of all parmlib types based on specified LOADxx, use:
    PUT/zosmf/parmlib/v1/LOAD/validate?memLOAD=LOADAC&dsnLOAD=SYS1.PARMLIB&deep=true

    The response includes all the supported parmlib type validation results.

Error code

All errors are reported to in the form of a JSON Error Report document (see JSON document specifications). The REST API classifies all errors by 'Reason'. There are 16 reasons codes that are shown in the table. Each reason code is shown with its corresponding message in the same row.

Reason Code Message
1 User is not authorized to use the parmlib Management Syntax Validation.
3 The input value in the URI is not valid. Correct this value and try the request again.
5 The request cannot get the validation result from the system when it calls the PSV API due to FileNotFoundException.
7 The request cannot get the validation result from system when it calls the PSV API due to IOException.
9 The request cannot get the validation result from the system when it calls the PSV API due to PM_IllegalArgumentException. This is caused when the JSON file uses a key word that is not supported by the program. It might be because of the keyword description override relationship, which must be either FIRSTEFFECT, CONCATENATION, or LASTEFFECT. It might also be the value of a facility, which must be BY_PARSER in MVP now.
11 The request cannot get the validation result from the system when it calls the PSV API due to AbsentRequiredItemException, which indicates a gap in the data.
13 The request cannot get the validation result from the system when it calls the PSV API due to MalformedURLException.
15 The request cannot get the validation result from the system when it calls the PSV API due to SocketTimeoutException.
17 The request cannot get the validation result from the system when it calls the PSV API due to UnsupportedEncodingException.
19 The request cannot get the validation result from the system when it calls the PSV API due to ZFileException.
21 The request cannot get the validation result from the system when it calls the PSV API due to IndexOutOfBoundsException.
23 The request cannot get the validation result from the system when it calls the PSV API due to DSNNotFoundException, which is an IOException. This is caused by the dataset not being found.
25 The request cannot get the validation result from the system when it calls the PSV API due to GenerateParmibSyntaxException, which is caused by the failure of the syntax tree creation.
27 The request cannot get the validation result from the system when it calls the PSV API due to QueryOfValidationException. This is because you need to validate the query process to find the parmlib.
29 The request cannot get the validation result from the system when it calls the PSV API due to TsoReleventException, which is caused by the tso connection and data retrieving process.
31 The request cannot get the validation result from the system when it calls the PSV API due to ParserException, which is due to the content match process.
999 The request cannot get the validation result from the system when it calls the PSV API due to an unexpected error.

Example of the Response Body

{
    "errorData": {
        "reason": "3",
        "messages": "The \"membertype\" value \"ALLOC0\" is not valid. Correct this value and try the request again."
    }
}