Assigning default index values

You can create a Content Manager OnDemand application definition with an index field that does not always exist on the print page. If a value is not found for that field during indexing (if the field location does not exist on the particular print page), then the DEFAULT keyword is used to determine the default value to use. The DEFAULT keyword can be placed on the FIELD indexer parameter line of the indexer parameters for a particular application definition.

If the field location does not exist on the particular print page, and a default value is not specified, blanks are used. For string fields, this allows the load to complete successfully. For date, decimal, and integer fields, this results in the load failing.

The DEFAULT keyword can be specified in one of three ways. The first method allows you to specify an actual value (given in alphanumeric or hex format). The second method allows you to use the default value that you have specified on the Load Information tab of the Content Manager OnDemand application definition or to use index propagation. The third method allows you to use a value that is found in the first document of the input file that can be used in all of the remaining documents.

Examples of the first method:
DEFAULT='your_Value'
(such as DEFAULT='ABC')
or
DEFAULT=x'your_Hex'
(such as DEFAULT=x'C1C2C3')
Examples of the second method:
DEFAULT='_*USELOADDEFAULTORPROPAGATION*_'
or
DEFAULT=x'6D5CE4E2C5D3D6C1C4C4C5C6C1E4D3E3D6D9D7D9D6D7C1C7C1E3C9D6D55C6D'
(In this second case, the hex value specified is the hexadecimal representation of the character string _*USELOADDEFAULTORPROPAGATION*_.)
Examples of the third method:
DEFAULT='_*FINDONCE*_'
or
DEFAULT=X'6D5CC6C9D5C4D6D5C3C55C6D'
(In this third case, the hex value specified is the hexadecimal representation of the character string _*FINDONCE*_.)

The second method (using _*USELOADDEFAULTORPROPAGATION*_ or its hexadecimal representation) allows the load process to assign the default value from the Load Information tab of the application definition or for propagation to occur. To have the load process assign a default from the Load Information tab or by using propagation, you must specify the _*USELOADDEFAULTORPROPAGATION*_ default value or click the Use Load Default or Propagation checkbox when defining the field by using the OnDemand Administrator client.

To have the load process assign a default from the Load Information tab, you must specify one by using the OnDemand Administrator client. If you have not specified a default, propagation occurs. Propagation is the process of carrying a value over from its previously found value. This can be useful but can also have unintended results. For example, if the field was a customer number, the value for customer number is carried from the previous document if one was not found for the current document. This might not be what you intend to happen. Exercise caution when using this second method, as propagation can occur.
Important: Consider the following notes when you are using _*USELOADDEFAULTORPROPAGATION*_:
  • With propagation, the loading of the spooled file will fail if an actual field value is not found on the print page for the first document in the spooled file, since there would be nothing to propagate into that field.
  • _*USELOADDEFAULTORPROPAGATION*_ cannot be used on a FIELD defined with a mask, such as MASK=##/##/##.
To further understand the use of _*USELOADDEFAULTORPROPAGATION*_, consider the following sample report. Notice that a value for the Code field does not appear on every printed page.
10/04/2006      Code:           K
                Account Number: 123456798
                Invoice Number: 876544-11

10/04/2006
                Account Number: 123456987
                Invoice Number: 876545-08
The indexer parameters might look something like this:
TRIGGER1=*,42,X'61',(TYPE=GROUP) /* / */
TRIGGER2=*,60,X'C39684857A',(TYPE=FLOAT) /* Code: */
FIELD1=0,40,10,(TRIGGER=1,BASE=0)
FIELD2=1,66,9,(TRIGGER=1,BASE=0)
FIELD3=2,66,9,(TRIGGER=1,BASE=0)
FIELD4=0,66,1,(TRIGGER=2,BASE=0,
  DEFAULT=X'6D5CE4E2C5D3D6C1C4C4C5C6C1E4D3E3D6D9D7D9D6D7C1C7C1E3C9D6D55C6D') 
  /* _*USELOADDEFAULTORPROPAGATION*_ */
INDEX1=X'A2A381A385948595A36D8481A385',FIELD1,(TYPE=GROUP,BREAK=YES) /* statement_date */
INDEX2=X'81838396A495A36D95A494828599',FIELD2,(TYPE=GROUP,BREAK=YES) /* account_number */
INDEX3=X'8995A5968983856D95A494828599',FIELD3,(TYPE=GROUP,BREAK=YES) /* invoice_number */
INDEX4=X'83968485',FIELD4,(TYPE=GROUP,BREAK=NO) /* code */
If you need the value of 'K' that is found for the first account number/invoice number to be propagated to the second account number/invoice number, you would NOT specify a default for the Code field on the Load Information page of the Content Manager OnDemand application definition. The use of _*USELOADDEFAULTORPROPAGATION*_ without a default specified on the Load Information page of the application causes propagation to occur. If, instead, you need to specify a different default value (such as 'D') to be used when the field value is not found on the page, your indexer parameters would look exactly the same as shown in the preceding example, but you would specify the 'D' for Default Value on the Load Information page to cause Content Manager OnDemand to assign a 'D' to the Code field for the second account number/invoice number.
The third method (using _*FINDONCE*_ or its hexadecimal representation) allows the load process to find a default value in the first document of the input file and use that value in all of the other remaining documents. For any field that contains the _*FINDONCE*_ default value, the value for the field is found once, in the first document, and then that value is propagated to the remaining documents in the spooled file. This function is especially useful for date fields which, if not found, cause the load to fail. To have the load process assign a default by using a value found in the first document, you must specify the _*FINDONCE*_ default value or click the Find Once checkbox when defining the field by using the OnDemand Administrator client.
Important: Consider the following notes when you are using _*FINDONCE*_:
  • This special default value is ONLY valid for TRIGGER-based fields.
  • This special default value is valid for any field type.
To further understand the use of _*FINDONCE*_, consider the following sample indexer parameters:
TRIGGER1=*,42,X'61',(TYPE=GROUP) /* / */
TRIGGER2=*,60,X'C39684857A',(TYPE=FLOAT) /* Code: */
FIELD1=0,40,10,(TRIGGER=1,BASE=0)
FIELD2=1,66,9,(TRIGGER=1,BASE=0)
FIELD3=2,66,9,(TRIGGER=1,BASE=0)
FIELD4=0,78,12,(TRIGGER=2,BASE=0,
  DEFAULT=X'6D5CC6C9D5C4D6D5C3C55C6D') /* _*FINDONCE*_ */
INDEX1=X'A2A381A385948595A36D8481A385',FIELD1,(TYPE=GROUP,BREAK=YES) /* statement_date */
INDEX2=X'81838396A495A36D95A494828599',FIELD2,(TYPE=GROUP,BREAK=YES) /* account_number */
INDEX3=X'8995A5968983856D95A494828599',FIELD3,(TYPE=GROUP,BREAK=YES) /* invoice_number */
INDEX4=X'83968485',FIELD4,(TYPE=GROUP,BREAK=NO) /* code */