VERIFIED SOLUTION i

MailStream Plus- How does the P ATTR parameter(s) work. What does the error message "1050: Piece-ID not found and no x default" mean. Why does P ATTR parameter position 14 say that the Length cannot exceed the Piece ID Length defined on the parameter.

Product affected: MailStream Plus™, all versions, all platforms
Information on using P ATTR parameters can be found in the MailStream Plus Guide, which is currently available at-
https://www.pitneybowes.com/us/support/products/software/mailstream-plus-support.html

The P ATTR parameter is used to identify the piece dimensions and other information about mail pieces.  If all of the pieces in a mailing are the same, then only a single P ATTR needs to be used.
If there are differences in the mail pieces, then more than one P ATTR should be used.  This allows MailStream Plus (MSP) to correctly prepare the mailing presort, and the postage.

Say some of the mail pieces are heavier and thicker than others.  The job may have 2 P ATTRs then, for example:
P ATTR 001 1 A         6.000 10.00 07.00 04.00                 R Y
P ATTR       B         7.000 15.00 07.00 04.00                 R Y
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+


The first P ATTR indicates a weight of 6 lbs per 100 pieces in positions 24-28, and a thickness of 10 inches per 100 pieces in positions 30-34.
The second P ATTR indicates a weight of 7 lbs per 100 pieces in positions 24-28, and a thickness of 15 inches per 100 pieces in positions 30-34.

How does MSP know which P ATTR to use for each record in the mailings?
As MSP reads the input Name-Address records, it looks for a P ATTR to match to one of the records.  In this example, the first P ATTR says (in positions 8-10 and 12) to look in position 001 in each input record for 1 byte.  Then that value is compared to position 14-22 of each P ATTR.  If the value in the input record in byte 1 is A, that the first P ATTR's data will be used.  If the value in the input record is B, then the second P ATTR will be used.

********************************************************************
If the value found in a record is for example a 'C', then MSP will error with the message-
"1050: Piece-ID not found and no C default"
saying that there was no P ATTR found in the job to use for records that have a C.
The solution would be to add another P ATTR with the correct information for 'C' records, or, you could mark one of the existing P ATTRs in the job as the default by putting a 'Y' in position 72, such as 
P ATTR 001 1 A         6.000 10.00 07.00 04.00                 R Y     Y
P ATTR       B         7.000 15.00 07.00 04.00                 R Y
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+

That would tell MSP to use the first P ATTR as the default for any records that it could not match per the codes 'A' and 'B'.  This should only be done if the unmatched records in the mailing *should* be using the information specified on the first P ATTR.

The codes are not required to be only 1 byte long.  Up to 9 bytes can be used for the matching code string in the input records and in P ATTR positions 14-22.

A further NOTE about using P ATTR position 72 to indicate a default P ATTR-
MSP abends with the error at the *first* record that has a Piece ID code that does not match a P ATTR when there is no default.
So with a record in a job that had 'C' for example, MSP errors as soon as it sees that record and finds there is no P ATTR for C (and no default is in the job).
There may be other records that do not match as well, but MSP does not report all of them.  
For example, *maybe* there was also a record with 'D', which in this example also didn't have a specific P ATTR for it.  But MSP abended on the C record first so it is not known if there was a 'D', etc.

If one of the the P ATTRs is made the default (by putting a Y in position 72), then it is going to be used for *any* record that does not have a specific P ATTR to match to.  So it would be used for any C records, but also for any D records (in this example), and any other records with codes that do not match to a specific P ATTR in the job.  

So using the option of making one of the P ATTRs a default should be used with caution, only if it is known that *any* unmatched record in the job should use that default P ATTR and it's length, thickness, weight, etc.

**********************************************************************
Why does the P ATTR parameter position 14 text say that the Length cannot exceed the Piece ID Length defined on the parameter?  
Because although only the length specified in position 12 of the first P ATTR is used for data from the input records, the *entire* field 14-22 on the P ATTRs is used. 
As mentioned, the fields actually allow up to 9 bytes long. 
In the first example above, the P ATTR was to look in the input records in just byte 1.  So from the input records MSP would pull the single-byte A, or B.
MSP then tries to match that string to the *full* code in P ATTRs positions 14-22.  In the examples above, only position 14 of the P ATTRs is populated with 'A' or 'B'.  That matches to the codes from the input records.
But if the P ATTR string in 14-22 had more than just one byte, say AA or BB in them, then the data from the input records ('A' or 'B') will not match the AA or BB field on the P ATTRs.  
That is why the length of the data in 14-22 should be the same length as specified in P ATTR position 12.
UPDATED:  July 1, 2019