How to test FTP command without a communication line in IBM i(AS400)?

Using FTP loopback in IBM i (AS400) for testing FTP command without having a communication line.
How to test FTP command without a communication line in IBM i(AS400)?, ftp, file transfer protocol, FTP in ibmi, ftp in as400, ftp in ibm i, iseries, systemi, as400, ibmi, as400andsqltricks,as400 tutorial, ibmi tutorial, FTP without having remote machin in IBM i, ftp commands, bin, namefmt 1, ftp loopback, put
How to test FTP command without a communication line in IBM i(AS400)?

When there is no communication line exists or accessible to us and we want to test the FTP commands on the local IBM i machine then there is a way to test the FTP commands. Therefore, In this article i will put some light on the same for you to get some insight.

Let's discuss the approach to test the FTP commands without any communication line/remote machine in IBM i.

FTP loopback

Try to use loopback instead of domain name/ip address this will start a session where the remote machine is actually the local IBM i(AS400) machine.

  • Type FTP loopback on IBM i command line and then press Enter
  • MAIN                           IBM i Main Menu                                 
                                                                System:   PUB400   
    Select one of the following:                                                   
                                                                                   
         1. User tasks                                                             
         2. Office tasks                                                           
         3. General system tasks                                                   
         4. Files, libraries, and folders                                          
         5. Programming                                                            
         6. Communications                                                         
         7. Define or change the system                                            
         8. Problem handling                                                       
         9. Display a menu                                                         
        10. Information Assistant options                                          
        11. IBM i Access tasks                                                     
                                                                                   
        90. Sign off                                                               
                                                                                   
    Selection or command                                                           
    ===> ftp loopback                                                              
                                                                                   
  • This will start the FTP session where the remote machine is local AS400 machine.
  •                                                        File Transfer Protocol                                                      
                                                                                                                                       
     Previous FTP subcommands and messages:                                                                                            
       Connecting to host LOOPBACK at address 127.0.0.1 using port 21.                                                                 
       220-QTCP at LOOPBACK.                                                                                                           
       220 Connection will close if idle more than 1666 minutes.                                                                       
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
     Enter login ID (easyclass):                                                                                                       
     ===>                                                                                                                              
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
     F3=Exit     F6=Print       F9=Retrieve                                                                                            
     F17=Top    F18=Bottom    F21=CL command line                                                                                      
  • Enter User Id, then password, then BIN for transferring Binary image and then NAMEFMT 1 for name format *PATH to access the files in the IFS
  •                                                        File Transfer Protocol                                                      
                                                                                                                                       
     Previous FTP subcommands and messages:                                                                                            
       Connecting to host LOOPBACK at address 127.0.0.1 using port 21.                                                                 
       220-QTCP at LOOPBACK.                                                                                                           
       220 Connection will close if idle more than 1666 minutes.                                                                       
     > easyclass                                                                                                                       
       331 Enter password.                                                                                                             
       230 EASYCLASS logged on.                                                                                                        
        OS/400 is the remote operating system. The TCP/IP version is "V7R4M0".                                                         
       250  Now using naming format "1".                                                                                               
       257 "/home/EASYCLASS" is current directory.                                                                                     
     > bin                                                                                                                             
       200 Representation type is binary IMAGE.                                                                                        
     > namefmt 1                                                                                                                       
       250  Now using naming format "1".                                                                                               
       Server NAMEFMT is 1.                                                                                                            
       Client NAMEFMT is 1.                                                                                                            
                                                                                                                                       
     Enter an FTP subcommand.                                                                                                          
     ===>                                                                                                                              
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       
     F3=Exit     F6=Print       F9=Retrieve                                                                                            
     F17=Top    F18=Bottom    F21=CL command line                                                                                      
  • Put the savefile TESTSAV2 from library EASYCLASS1 to EASYCLASS2.
  •                                                        File Transfer Protocol                                                       
                                                                                                                                        
     Previous FTP subcommands and messages:                                                                                             
        OS/400 is the remote operating system. The TCP/IP version is "V7R4M0".                                                          
       250  Now using naming format "1".                                                                                                
       257 "/home/EASYCLASS" is current directory.                                                                                      
     > bin                                                                                                                              
       200 Representation type is binary IMAGE.                                                                                         
     > namefmt 1                                                                                                                        
       250  Now using naming format "1".                                                                                                
       Server NAMEFMT is 1.                                                                                                             
       Client NAMEFMT is 1.                                                                                                             
     > put /qsys.lib/easyclass1.lib/testsav2.savf /qsys.lib/easyclass2.lib/testsav2.savf                                                
                                                                                                                                        
                                                                                                                                        
       229 Entering Extended Passive Mode (!!!49598!).                                                                                  
       150 Sending file to member TESTSAV2 in file TESTSAV2 in library EASYCLASS2.                                                      
       226 File transfer completed successfully.                                                                                        
       164736 bytes transferred in 0.059 seconds. Transfer rate 2811.494 KB/sec.                                                        
     Enter an FTP subcommand.                                                                                                           
     ===>                                                                                                                               
                                                                                                                                        
                                                                                                                                        
                                                                                                                                        
  • Type QUIT to exit from the FTP session.
  • Type wrkobj easyclass2/testsav2 on command line and press Enter. The save file TESTSAV2 gets transferred to library EASYCLASS2 on the same local machine.
  •                                Work with Objects                             
                                                                                 
     Type options, press Enter.                                                  
       2=Edit authority        3=Copy   4=Delete   5=Display authority   7=Rename
       8=Display description   13=Change description                             
                                                                                 
     Opt  Object      Type      Library     Attribute   Text                     
          TESTSAV2    *FILE     EASYCLASS2  SAVF                                 

    Post a Comment

    © AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain