"G1IMBXRF Environment variable not set" error in MailStream Plus

Product affected: MailStream Plus™
Platforms: Windows, UNIX/Linux, z/OS


Job abends with "G1IMBXRF Environment variable not set" or similar error in the <jobname>.xlg *Windows/UNIX) or MSRPXLG (z/OS).


G1IMBXRF Environment variable not set


UPDATED: May 14, 2019
This error occurs when the job is set to produce the 'Mail Piece File' but there is no G1IMBXRF variable set to tell the job where to write the file to.
The IMBCTL parameter's position 28 would be set to X or M to select to generate the Mail Piece File. 
The only intended purpose of generating that file is so it can be loaded into Pitney Bowes Software's 'Mail360 Data Manager™' application.  (Also later called 'EngageOne™ Delivery Audit' and currently called 'EngageOne™ Inform')

If Mail360 Data Manager is not being used by your business, then the job does not need to generate the Mail Piece file, so it does not need to be selected. Removing the X or M option will resolve the error.

If the Mail Piece File *is* needed, the variable can be added in one of two ways:
1) It can be added to the System Variables list via 'Start->Settings->Control Panel->System-> 'Advanced' tab->Environment Variables.
2) Alternatively, if MailStream Plus is only being used in batch mode it can be added to the <jobname>.bat file using something similar to-
SET G1IMBXRF=C:\mailpiecefile.txt

G1IMBXRF="${PBMSP}/data/${PBJOB}.xrf";         export DD_G1IMBXRF

// SPACE=(CYL,(50,50),RLSE),VOL=SER=volume,
// DSN=your.mail.piece.file,