IBM i Global

IBM i Global

Connect, learn, share, and engage with IBM Power.

 View Only
Expand all | Collapse all

FTP Error

  • 1.  FTP Error

    Posted Fri October 25, 2024 07:10 AM

    Hi,

    Any idea how to rewrite these commands to get rid off these FTP errors?

    ftp> ascii
    200 Representation type is ASCII nonprint.
    ftp> get qsys.lib/l1.lib/f1.file/SPL1.MBR SPL1.MBR
    200 PORT subcommand request successful.
    501 Specified object name too long, limit is 10 characters: lib/f1.file/SPL1.MBR.
    ftp> get qsys.lib/l1.lib/f1.file/spl1.mbr spl1.mbr
    200 PORT subcommand request successful.
    501 Specified object name too long, limit is 10 characters: lib/f1.file/spl1.mbr.
    ftp> get qsys.lib/l1.lib/f1.file/spl1.mbr spl1.mbr

    Thanks



    ------------------------------
    jerry ven
    ------------------------------


  • 2.  RE: FTP Error

    Posted Fri October 25, 2024 07:40 AM
    Edited by Rohit Chauhan Fri October 25, 2024 08:04 AM

    Hi @jerry ven,

    You can change the local and working directory in one command first and just fetch the file name . So actual command sequence would look like below.

    ftp> ascii

    200 Representation type is ASCII nonprint.

    ftp>cd l1                   
    250 "l1.lib" is current library.  

    ftp>lcd l1                        
    250 Local working directory is l1.lib 

    ftp> get f1.file....



    ------------------------------
    Rohit Chauhan
    Senior Technical Specialist
    Norway
    ------------------------------



  • 3.  RE: FTP Error

    Posted Fri October 25, 2024 07:58 AM

    tried it but got these errors:-

    ftp> ascii
    200 Representation type is ASCII nonprint.
    ftp> cd l1
    250 "L1" is current library.
    ftp> lcd l1
    l1: File not found
    ftp> lcd c:
    : File not found
    ftp> lcd l1.lib
    l1.lib: File not found
    ftp> get f1.file/spl1.mbr spl1.mbr
    200 PORT subcommand request successful.
    550  Library F1.FILE not found.
    ftp> get l1.lib/fi.file/spl1.mbr spl1.mbr
    200 PORT subcommand request successful.
    501 Specified object name too long, limit is 10 characters: file/spl1.mbr.
    ftp>

    Thanks




  • 4.  RE: FTP Error

    Posted Fri October 25, 2024 08:04 AM
    Edited by Rohit Chauhan Fri October 25, 2024 08:21 AM

    Hi Jerry,

    It looks like you are hitting the max 10 characters limit in the QSYS file system.When uploading/downloading a file to an IBM i, each of the library, file and member name should not exceed 10 characters. 

    Are you trying ftp from PC to IBM i or IBM i to IBM i ?

    What is your source path ?

    Regards,

    Rohit



    ------------------------------
    Rohit Chauhan
    Senior Technical Specialist
    Norway
    ------------------------------



  • 5.  RE: FTP Error

    Posted Fri October 25, 2024 08:25 AM

    from IBM i to local disk drive's folder let's say here from l1.lib/f1.file/spl1.mbr  to local desktop' C drive ( in any of C drive's folder/subfolder etc.)

    Thanks




  • 6.  RE: FTP Error

    Posted Fri October 25, 2024 11:53 AM

    Hi,

    Could someone please advise here for the same?

    Thanks much...




  • 7.  RE: FTP Error

    Posted Fri October 25, 2024 12:01 PM
    Hello Jerry,

    My guess is that you are mixing name format modes here.
    • Name format 0 is the QSYS old-school Library/file.member naming scheme
    • Name format 1 is the IFS new-school /QSYS.lib/Libname.lib/Fname.file/Mname.mbr naming scheme

    You can detect and switch between modes like so:

    ftp> quote site namefmt 1
    250  Now using naming format "1".
    ftp> pwd
    257 "/QSYS.LIB/QGPL.LIB" is current library.
    ftp> quote site namefmt 0
    250  Now using naming format "0".
    ftp> pwd
    257 "QGPL" is current library.  

    You can see help by typing "quote help":

    ftp> quote help
    214-Server-FTP commands follow:
    214-Unsupported commands marked with an *.
    214-ABOR, ACCT*, ADDM, ADDV, ALLO*, APPE, AUTH, CDUP, CRTL, CRTP, CRTS,
    214-CWD, DELE, DLTF, DLTL, EPRT, EPSV, FEAT, HELP, LIST, MKD, MODE,
    214-NLST, NOOP, OPTS, PASS, PASV, PBSZ, PORT, PROT, PWD, QUIT, RCMD,
    214-REIN, REST*, RETR, RMD, RNFR, RNTO, SITE, STAT, STOR, STOU, STRU,
    214-SYST,  TIME,  TYPE,  USER,  XCUP,  XCWD,  XMKD.
    214-The data representation type may be ASCII(A), EBCDIC(E), binary IMAGE(I),
    214-DBCS_ASCII(B), DBCS_EBCDIC(F) or CCSID(C).
    214-Data structure must be file(F) or record(R).  Mode can be stream (S) or block (B).
    214-If this connection is not used more than 300 seconds, the session will end.
    214-Name Format 0 :
    214-File identifiers have three components: File, library, and member.
    214-Library and file components are separated by the / delimiter.
    214-File and member components are separated by the . delimiter.
    214-Example:  Library/file.member.
    214-Name Format 1 :
    214-Directory levels separated by the / delimiter.
    214-Database files use format: /QSYS.lib/Libname.lib/Fname.file/Mname.mbr
    214-Documents (files) stored in folders use format: /QDLS/folder/document.ext
    214-Integrated File Systems include: "root" (/), QOpenSys, QLANSrv.
    214-Integrated File System files use format: /fsname/fsdependentnamingformat
    214 For information about a specific command, enter HELP <command>.


    Hope this helps!

    Cheers,
    Roman





  • 8.  RE: FTP Error

    Posted Fri October 25, 2024 02:09 PM

    Hi Jerry,

    As i said you are hitting the maximum characters of 10 as you are using "namefmt 0" which is default when you first login to ftp. Can you please try the below command to change it to "namefmt 1" so that you are under native Integrated file system structure. Please try the below .. 

    ftp> ascii
    200 Representation type is ASCII nonprint.

    ftp> quote site namefmt 1

    ftp>250  Now using naming format "1".

    ftp> get qsys.lib/l1.lib/f1.file/SPL1.MBR SPL1.MBR



    ------------------------------
    Rohit Chauhan
    Senior Technical Specialist
    Norway
    ------------------------------



  • 9.  RE: FTP Error

    Posted Mon October 28, 2024 03:27 PM

    Hello,

    I may not have a good grasp of what the problem is, but I can FTP with the following assumptions.

    • FTP server is IBM i, client is Windows (command prompt)
    • Receive internally described or source physical file to Windows with EBCDIC->ASCII conversion

    Operation :

    (Preparation on the IBM i side)

    > crtlib lib1

    > CRTPF FILE(LIB1/F1) RCDLEN(100) MAXMBRS(*NOMAX)

    > CPYF FROMFILE(QSYSINC/QRPGLESRC) TOFILE(LIB1/F1) FROMMBR(CMRPG) TOMBR(*FR
      OMMBR) MBROPT(*REPLACE) FMTOPT(*CVTSRC)

    (FTP from Windows command prompt)

    C:\Users\user>cd Documents
     
    C:\Users\user\Documents>ftp 192.168.0.xxx
    Connected to 192.168.0.xxx.
    220-QTCP AT XXXXXXX.
    220 CONNECTION WILL CLOSE IF IDLE MORE THAN 5 MINUTES.
    501 OPTS UNSUCCESSFUL; SPECIFIED SUBCOMMAND NOT RECOGNIZED.
    User (192.168.0.xxx:(none)): XXXXX
    331 ENTER PASSWORD.
    Password:
     
    230 XXXX LOGGED ON.
    ftp> ascii
    200 REPRESENTATION TYPE IS ASCII NONPRINT.
    ftp> quote site namefmt 1
    250  NOW USING NAMING FORMAT "1".
    ftp> get /qsys.lib/lib1.lib/f1.file/cmrpg.mbr cmrpg.txt
    200 PORT SUBCOMMAND REQUEST SUCCESSFUL.
    150 RETRIEVING MEMBER CMRPG IN FILE F1 IN LIBRARY LIB1.
    226 FILE TRANSFER COMPLETED SUCCESSFULLY.
    ftp: 13119 bytes received in 0.02Seconds 771.71Kbytes/sec.
    ftp> quit
    221 QUIT SUBCOMMAND RECEIVED.



    ------------------------------
    Hideyuki Yahagi
    ------------------------------



  • 10.  RE: FTP Error

    Posted Mon October 28, 2024 03:32 PM

    You can consider using ACS Data Transfer GUI.



    ------------------------------
    ZhenQuan Li
    ------------------------------