URL: https://www.ibm.com/support/pages/system/files/inline-files/rpltest.rpgle_.txt
**free
// price_msg - a data structure for the MULTRPL generator for DATA-GEN
// - the first subfield is the message template
// - the second subfield is the character that surrounds the replacement names
// - the remaining subfields are the replacement subfields
dcl-ds price_msg qualified inz;
message varchar(100) inz('The price of item "%ITEM%" is $%PRICE%.');
marker char(1) inz('%');
item varchar(20);
price packed(5:2);
end-ds price_msg;
// A variable to receive the formatted message
dcl-s output varchar(100);
// This DATA-GEN will substitute ITEM and PRICE
price_msg.item = 'Table';
price_msg.price = 123.45;
data-gen price_msg %data(output) %gen('MULTRPL');
// Display the result: The price of item "Table" is $123.45.
dsply output;
return;