ILE RPG Code Sample for Creating a 5000 character message field from within an ILE RPG program for use with the SMTPSEND, SMTPDB2 and other SMTP/400 commands.
 
D*****************************************************************      
D*  ILE RPG Code Sample for Creating a 5000 character message field from 
D* within an ILE RPG program.
D*****************************************************************      
D*****************************************************************      
D* WORK FIELDS AND CONSTANTS                                            
D*****************************************************************      
D CRLF            S              2A   Inz(X'0D25')                      
D MsgLine4        S             30A   Inz('This is text line 4’)                
D MsgText         S           5000A                                     
D*****************************************************************      
D*****************************************************************      
C* MAIN LINE CALCULATIONS                                               
C*****************************************************************      
C*                                                                  
C*****************************************************************      
C* Concatenate Text into Multiple Lines
C* Ideally each line should be 80-100 characters or less for readability.
C* The first 3 lines are fixed text and the 4th line is a variable named MsgLine4
C*****************************************************************      
C                   Eval      MsgText = 'This is a text line 1 ' +  CRLF + 
C                             'This is a text line 2' +  CRLF
C                             %trimr(MsgLine4) +  CRLF

 


Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: December 10, 2016