EssVerifyRulesFile

Verifies the syntax of the specified rules file.

Syntax

ESS_FUNC_M  EssVerifyRulesFile (hCtx, ruleFileName, pNmColumns, ppColumnErrors);
ParameterData TypeDescription

hCtx

ESS_HCTX_T

API context handle.

ruleFileName

ESS_STR_T

The name of the rules file to verify.

pNmColumns

ESS_PULONG_T

Pointer to the number of columns in the rules file.

ppColumnErrors

ESS_ULONG_T

Pointer to the array of errors found.

Notes

Return Value

If successful, returns the number of columns in the rules file as pNmColumns and the array of errors found in ppColumnErrors.

Access

This function requires no special privileges.

Example

{
   ESS_STS_T      sts = ESS_STS_NOERR;
   ESS_ULONG_T    numColumns = 0, i;
   ESS_PULONG_T   pColumnErrors = NULL;

   sts = EssVerifyRulesFile(hCtx, "rule_file", &numColumns, &pColumnErrors);
   if(!sts) 
   {
      if(numColumns && pColumnErrors) 
      {
         printf("NumColumns: %d\n", numColumns);
         for(i=0; i<numColumns; i++) 
         {
            printf("Column[%d]:\n", i+1);
            if( pColumnErrors[i] == 0 )
               printf("     No error\n");
            else 
            {
               if( pColumnErrors[i] & DAT_VERIFY_INVALIDMBR )
                  printf("     There is an unknown member (or no member) in the field name.\n");
               if( pColumnErrors[i] & DAT_VERIFY_INVALIDHDR )
                  printf("     There is an unknown member in the header.\n");
               if( pColumnErrors[i] & DAT_VERIFY_SAMENAME )
                  printf("     This field has the same field name as another field.\n");
               if( pColumnErrors[i] & DAT_VERIFY_DIMUSED )
                  printf("     The dimension name is used in another field name or in the header.\n");
               if( pColumnErrors[i] & DAT_VERIFY_MBRUSED )
                  printf("     A member name used as part of a combination in this field is used as a single 
                                  member name in another field.\n");
               if( pColumnErrors[i] & DAT_VERIFY_DIMINCROSSDIM )
                  printf("     A dimension name is used in a cross-dimensional reference in the field name.\n");
               if( pColumnErrors[i] & DAT_VERIFY_DATAFIELD )
                  printf("     Only one field can have the Data Field attribute.\n");
               if( pColumnErrors[i] & DAT_VERIFY_SIGNFLIPDIM )
                  printf("     The dimension used for Sign Flip checking is not in the associated outline.\n");
               if( pColumnErrors[i] & DAT_VERIFY_DUPINHEADER )
                  printf("     This field name is also defined in the header definition.\n");
               if( pColumnErrors[i] & DAT_VERIFY_DATEANDDATA )
                  printf("     A field may be designated a Data Field or a Date Field, but not both.\n");
               if( pColumnErrors[i] & DAT_VERIFY_DATEFIELDNAME )
                  printf("     The field name of a date field must be the name of a date dimension.\n");
               if( pColumnErrors[i] & DAT_VERIFY_DATEFORMAT )
                  printf("     There is an unrecognized date format for this date column.\n");
            }
         }
         EssFree(hInst, pColumnErrors);
      }
   }
}

See Also