Export flat file data as .txt

30 pts.
Tags:
CL Program
Flat files
RPGLE
I have data in a flat file that I want to send to an external server in text file format. How can I do this within a RPGLE or CL program?


Software/Hardware used:
iSeries RPGLE
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    The easiest way I can think of would be to do it via FTP.
    131,440 pointsBadges:
    report
  • LarryL7078
    Yes, we are looking at that and it may be the easiest solution. Thanks Todd.
    30 pointsBadges:
    report
  • ToddN2000
    You can try something like this....

    Create **
    MYSOURCE/QCLLESRC member type TXT
    member name FTP - TXT file for FTP log  
    
    Create**
    MYSOURCE/QCLLESRC member type TXT
    member name FTP02 - TXT file of FTP commands
    
            *************** Beginning of data **
    0001.00 open MYISERIES                       
    0002.00 user ibm ibm                        
    0003.00 bin                                 
    0004.00 PUT qgpl/sndFILE qgpl/sndFILE         
    0005.00 close                               
    0006.00 QUIT                                
            ****************** End of data *****
    
    Create**
    MYSOURCE/QCLLESRC member type CLP
    member name FTP01 - program to send file
    
                 PGM                                                         
                 CPYF       FROMFILE(MYDATLIB/MYFILE) +                       
                            TOFILE(QGPL/sndFILE) MBROPT(*REPLACE)                               
                                                                             
                                                                            
                 OVRDBF     FILE(INPUT) TOFILE(QCLSRC) MBR(FTP02)            
                 OVRDBF     FILE(OUTPUT) TOFILE(QCLSRC) MBR(FTP)      
                                                                       
                 FTP        RMTSYS('10.10.10.10')                       
                                                                       
                 ENDPGM 
    131,440 pointsBadges:
    report
  • LarryL7078
    Thank-you. Will give it a try,
    30 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: