PGM                                                       
                                                                  
DCL        VAR(&USER) TYPE(*CHAR) LEN(10) VALUE(TEST)     
                                                                  
DCL        VAR(&RTFFILE) TYPE(*CHAR) LEN(20) +            
            VALUE(REPORT.RTF)                            
                                                                  
DCL        VAR(&IFSFILE) TYPE(*CHAR) LEN(255)             
                                                                 
/**********************************************/                       
/* SET UP IFS OUTPUT FILE NAME   */                                      
/**********************************************/                       
CHGVAR     VAR(&IFSFILE) VALUE('/REPORTS/' |< &USER |< +  
               '/' |< &RTFFILE)                             
                                                                 
/**********************************************/      
/* CONVERT TEXT REPORT TO RTF */                                       
/**********************************************/                       
RJSCONVERT/CPYSPLRTF FILE(QPJOBLOG) JOB(*) +              
           SPLNBR(*LAST) CTLCHAR(*PRTCTL) +             
           FILNAM(&IFSFILE)                             
                                                                 
ENDPGM                                                    

!!!

CL Sample for Using Low Level FTP/400 FTP API Commands
>>>
'''The following sample requires the RJSFTP library Version 1.19 or above.''' 

/* Connect to AS/400 FTP Server */
FTPCONNECT HOST('1.1.1.1') USER(TEST) PASSWORD(TEST)  

/* Change to NAMEFMT 1 so we can download using Unix based IFS naming */
/* This setting is only needed for another AS/400 system. Not required for NT/Unix FTP Servers */
FTPQUOTE QUOTE('SITE NAMEFMT 1')                     

/* Send file via FTP */
FTPPUTBIN LOCALFILE('/REPORT.PDF') REMOTEFILE('/REPORT.PDF') 

/* Receive File via FTP */
FTPGETBIN LOCALFILE('/REPORT1.PDF') REMOTEFILE('/REPORT1.PDF') 

/* Disconnect from AS/400 system */
FTPQUIT

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

Last Modified On: December 10, 2016