ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

FTP problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • FTP problem

    Hai,

    when i try to ftp a file from my D:\ drive to the AS/400 savf through the command prompt in this fashion


    ftp> bin
    200 Representation type is binary IMAGE.
    ftp> put M8267665C.dat /qsys.lib/qgpl.lib/M8267665C.savf
    200 PORT subcommand request successful.
    150-NAMEFMT set to 1.
    150 Sending file to member M8267665C in file M8267665C in library QGPL.
    > Netout :Software caused connection abort
    426-Cannot write to member M8267665C in file M8267665C in library QGPL.
    426 Data transfer ended.
    ftp: 196605 bytes sent in 0.13Seconds 1512.35Kbytes/sec.

    these are the errors i face can you plz help me out from this as u all did earlier.

    thanks a lot,
    senthil

  • #2
    Re: FTP problem

    Check the authority on the file M8267665C It looks like you dont have authority.


    EDTOBJAUT M8267665C *FILE


    Jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: FTP problem

      Originally posted by senthil
      Hai,

      when i try to ftp a file from my D:\ drive to the AS/400 savf through the command prompt in this fashion


      ftp> bin
      200 Representation type is binary IMAGE.
      ftp> put M8267665C.dat /qsys.lib/qgpl.lib/M8267665C.savf
      200 PORT subcommand request successful.
      150-NAMEFMT set to 1.
      150 Sending file to member M8267665C in file M8267665C in library QGPL.
      > Netout :Software caused connection abort
      426-Cannot write to member M8267665C in file M8267665C in library QGPL.
      426 Data transfer ended.
      ftp: 196605 bytes sent in 0.13Seconds 1512.35Kbytes/sec.

      these are the errors i face can you plz help me out from this as u all did earlier.

      thanks a lot,
      senthil

      The extension of the save file on the iSeries should be .file, not .savf. And it must already exist before you attempt the FTP.

      Michael
      "Time passes, but sometimes it beats the <crap> out of you as it goes."

      Comment


      • #4
        Re: FTP problem

        Michael, Id better start reading with both eye's


        from green screen create your savf

        crtsavf qgpl/mysavf

        then from dos

        ftp 192.168.1.1 (whatever your iseries IP)
        logon
        then type BIN (as you did)
        then
        put D:/M8267665C.dat QGPL\mysavf (replace


        (thanks Michael)
        Jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: FTP problem

          Thanks Jamie&Michael,

          when i work with the same authority as the savf created authority.
          file transfer log in the command prompt tells the files are transfered but when i check with the savf using dspsavf command as/400 tells
          no records in save file

          ftp> put m8267665a.dat /qgpl.lib.m8267665a.savf
          200 PORT subcommand request successful.
          150 Sending file to /qgpl.lib.m8267665a.savf
          250 File transfer completed successfully.
          ftp: 356928 bytes sent in 0.06Seconds 5948.80Kbytes/sec.

          i m new to administration so i could not locate this issue.

          i m waiting for ur reply


          Thanks
          senthil

          Comment


          • #6
            Re: FTP problem

            where did this .dat file come from?
            if it is a pc type file you want to put on IFS in a folder not in
            savefile.

            THe AS400 lives and breaths EBCDIC it kinda burps on ascii unless its on the IFS



            Jamie
            All my answers were extracted from the "Big Dummy's Guide to the As400"
            and I take no responsibility for any of them.

            www.code400.com

            Comment


            • #7
              Re: FTP problem

              Hai Jamie,

              Yeah then plz tell me how can i restore the objects from this kind of a file. i dont know how to restore this. plz give me some idea to do this.


              Thanks,
              senthil

              Comment


              • #8
                Re: FTP problem

                definition of .DAT extension
                Code:
                Can be just about anything: text, graphic, or general binary data. There is no
                specific structure for a .DAT file. You can use an editor like EditPad Pro to look
                 inside a .DAT file and possible determine its contents and relationship with a
                 program.

                If you have opperations (iseries) navigator just create a folder.

                from greescreen
                Code:
                MD DIR('home/myfolder') DTAAUT(*RWX) OBJAUT(*ALL)
                then drop your .dat file into this folder.
                use this program to read the file in an RPG PRogram. (you must modify a bit)

                Code:
                   H DFTACTGRP(*NO) BNDDIR('QC2LE')
                      *
                     FReadIFSD1 CF   E             WORKSTN SFILE(S1SFL:RRN1)
                
                      **************************************************************************
                      *
                    * * Prototypes and definitions for working with the IFS
                      *
                      **************************************************************************
                      *
                      *  open -- open an IFS file
                      *
                     D open            pr            10i 0   ExtProc('open')
                     D   filename                      *     value
                     D   openflags                   10i 0   value
                     D   mode                        10u 0   value options(*nopass)
                     D   codepage                    10u 0   value options(*nopass)
                      * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
                      *  read -- read an IFS file
                      *
                     D read            pr            10i 0   ExtProc('read')
                     D   filehandle                  10i 0   value
                     D   datareceived                  *     value
                     D   nbytes                      10u 0   value
                      * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
                      *  close- close an IFS file
                      *
                     D close           pr            10i 0   ExtProc('close')
                     D   filehandle                  10i 0   value
                      * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
                      * values for oflag parameter, used by open()
                     D O_APPEND        s             10i 0   inz(256)
                     D O_CODEPAGE      s             10i 0   inz(8388608)
                     D O_CREAT         s             10i 0   inz(8)
                     D O_EXCL          s             10i 0   inz(16)
                     D O_RDONLY        s             10i 0   inz(1)
                     D O_RDWR          s             10i 0   inz(4)
                     D O_TEXTDATA      s             10i 0   inz(16777216)
                     D O_TRUNC         s             10i 0   inz(64)
                     D O_WRONLY        s             10i 0   inz(2)
                
                      * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
                      * user authorities for omode parameter, used by open()
                      * from QSYSINC/SYS, member STAT
                     D S_IRUSR         s             10i 0   inz(256)
                     D S_IWUSR         s             10i 0   inz(128)
                     D S_IXUSR         s             10i 0   inz( 64)
                     D S_IRWXU         s             10i 0   inz(448)
                      * group authorities
                     D S_IRGRP         s             10i 0   inz( 32)
                     D S_IWGRP         s             10i 0   inz( 16)
                     D S_IXGRP         s             10i 0   inz(  8)
                     D S_IRWXG         s             10i 0   inz( 56)
                      * other authorities
                     D S_IROTH         s             10i 0   inz(  4)
                     D S_IWOTH         s             10i 0   inz(  2)
                     D S_IXOTH         s             10i 0   inz(  1)
                     D S_IRWXO         s             10i 0   inz(  7)
                      *
                
                     D RdIfsFil        PR            40A
                     D  FileName                     40A   CONST
                
                     D CodePage        S             10u 0 inz(819)
                     D Data_Rec        S            256A
                     D Eol             C                   Const(x'0D25')
                     D Error_Flag      S              1A   INZ('0')
                     D File            S             40
                     D FileName        S             40
                     D Fp              S             10i 0
                     D N               S              5  0
                     D Oflag           S             10i 0
                     D Omode           S             10u 0
                     D R               S              5  0
                     D Rc              S             10i 0
                     D Rrn1            S             10i 0
                      *---------------------------------------------------------
                      * MAIN
                      *---------------------------------------------------------
                     C                   Exsr      Clrsfl
                      *
                     C                   Dow       *In03 = *Off
                     C                   Write     S1Ftr
                     C                   Exfmt     S1Ctl
                     C                   If        *In03 = *On
                     C                   Eval      *Inlr = *On
                     C                   Return
                     C                   Endif
                      *
                      * If user entered an IFS path into the screen field, read that file
                     C                   If        Xfile > *Blanks
                     C                   Exsr      Clrsfl
                     C                   Eval      Error_Flag = RdIfsFil(XFile)
                     C                   If        Error_Flag =  '1'
                     C                   Eval      Rrn1 = Rrn1 + 1
                     C                   Eval      Data = '*ERROR! File Not Found in IFS'
                     C                   Write     S1Sfl
                     C                   Eval      *In91 = *On
                     C                   Else
                     C                   Eval      *In99 = *Off
                     C                   If        Rrn1 > 0
                     C                   Eval      *In91 = *On
                     C                   Endif
                     C                   Endif
                     C                   Endif
                      *
                     C                   Enddo
                      *
                      **************************************************************************
                      * Initialize subfile and display empty subfile
                      **************************************************************************
                     C     ClrSfl        Begsr
                
                     C                   Eval      *In89 = *On
                     C                   Eval      *In90 = *Off
                     C                   Eval      *In91 = *Off
                     C                   Write     S1Ctl
                     C                   Eval      Rrn1 = 0
                     C                   Eval      *In89 = *Off
                     C                   Eval      *In90 = *On
                     C                   Eval      *In91 = *Off
                
                     C                   Endsr
                      *-------------------------------------------------------------
                      *    RdIfsFil - Subprocedure To Read The IFS File
                      *-------------------------------------------------------------
                     P RdIfsFil        B                   Export
                     D RdIfsFil        PI            40A
                     D  FileName                     40A   Const
                     D CharsRead       S             10i 0
                     D CurChar         S              1
                     D Eof             C                   const(x'00')
                     C                   Eval      Oflag = O_Rdonly + O_Textdata
                     C                   Eval      File = %trim(FileName) + x'00'
                     C                   Eval      Fp = open(%addr(File): Oflag)
                     C                   If        Fp < 0
                     C                   Eval      Error_Flag = *On
                     C                   Return    Error_Flag
                     C                   Endif
                
                     C                   Eval      R = 0
                     C                   Eval      N = 0
                     C                   Eval      Data_Rec = *Blanks
                     C                   Exsr      GetChar
                     C                   Dow       CurChar <> Eof
                     C                   Select
                     C                   When      R = 78
                     C                   Exsr      Write_Sfl
                     C                   Eval      R = *zero
                     C                   Eval      Data_Rec = *blanks
                     C                   Other
                     C                   Eval      R = R + 1
                     C                   Eval      %Subst(Data: R: 1) = CurChar
                     C                   Endsl
                     C                   Exsr      GetChar
                     C                   Enddo
                     C                   Exsr      Write_Sfl
                
                      * Now close the IFS File
                     C                   CallP     Close(Fp)
                
                     C                   Return    Error_Flag
                      *---------------------------------------------------------
                      *    GetChar - Process IFS Record, One Character At A Time
                      *---------------------------------------------------------
                     C     GetChar       begsr
                      *        If input buffer is empty, or all characters have been
                      *          processed, refill the input buffer.
                     C                   If        N = CharsRead
                     C                   Eval      Data   = *Blanks
                     C                   Eval      CharsRead = Read(Fp:
                     C                             %Addr(Data_Rec): 256)
                     C                   Eval      N = *Zero
                     C                   Endif
                      *        Get the next character in the input buffer.
                     c                   If        CharsRead <= 0
                     C                   Eval      CurChar = Eof
                     C                   Else
                     C                   Eval      N = N + 1
                     C                   Eval      CurChar = %Subst(Data_Rec: N: 1)
                     C                   Endif
                     C                   Endsr
                      *-------------------------------------------------------------
                      *    Write_Sfl - Write Subfile Record
                      *-------------------------------------------------------------
                     C     Write_Sfl     Begsr
                     C                   Eval      Rrn1 = Rrn1 + 1
                     C                   Write     S1Sfl
                     C                   Endsr
                     P RdIfsFil        E
                
                
                ======================DSp FIle==========================================
                     A                                      CA03(03 'EXIT')          
                     A                                      DSPSIZ(24 80 *DS3)       
                     A          R S1SFL                     SFL                      
                     A            DATA          78A  O  3  2                         
                     A          R S1CTL                     SFLCTL(S1SFL)            
                     A*%%TS  SD  20030522  103716  SHANNON     REL-V5R1M0  5722-WDS  
                     A                                      SFLSIZ(0021)             
                     A                                      SFLPAG(0020)             
                     A                                      OVERLAY                  
                     A  91                                  SFLDSP                   
                     A  90                                  SFLDSPCTL                
                     A  89                                  SFLCLR                   
                     A  99                                  SFLEND(*MORE)            
                     A                                  1 16'CONTENTS OF IFS FILE:'  
                     A                                      DSPATR(HI)               
                     A            XFILE         40   B  1 38CHECK(ER)                
                     A                                      CHECK(LC)                
                                                                                     
                     A          R S1FTR                                              
                     A                                 24  3'F3=EXIT'                
                     A                                      COLOR(BLU)
                All my answers were extracted from the "Big Dummy's Guide to the As400"
                and I take no responsibility for any of them.

                www.code400.com

                Comment


                • #9
                  Re: FTP problem

                  Who is this "Mike" to whom you are referring?

                  Michael
                  "Time passes, but sometimes it beats the <crap> out of you as it goes."

                  Comment


                  • #10
                    Re: FTP problem

                    Im not sure Mike who
                    All my answers were extracted from the "Big Dummy's Guide to the As400"
                    and I take no responsibility for any of them.

                    www.code400.com

                    Comment


                    • #11
                      Re: FTP problem

                      LOL.

                      So you edit everyone's post but mine, making me look like a bonehead? Nice!
                      "Time passes, but sometimes it beats the <crap> out of you as it goes."

                      Comment


                      • #12
                        Re: FTP problem

                        Im the bonehead I just have edit rights

                        Have a great weekend!

                        Jamie
                        All my answers were extracted from the "Big Dummy's Guide to the As400"
                        and I take no responsibility for any of them.

                        www.code400.com

                        Comment


                        • #13
                          Re: FTP problem

                          hi all I am trying to ftp a text file from my local pc to iseries server but i am not able to do it.

                          please help me how to upload and if you any matrial on ftp or IFS please let me know the link as well.

                          i am trying this....

                          200 Representation type is binary IMAGE.
                          put c:/hotel.txt QGPL\mysavfile
                          Character ( is not allowed in object name.
                          bin
                          200 Representation type is binary IMAGE.
                          put hotel.txt QGPL\mysavfile
                          File HOTEL in library PANDEYFL1 not found.

                          hotel.txt is text file in c drive(local)
                          Last edited by pramendra; July 2, 2009, 11:22 PM.
                          Young people knows how to run fast but old people knows the way..

                          Comment


                          • #14
                            Re: FTP problem

                            This error usually happens if your profile on the iseries is maxed out on storage. Use the CHGUSRPRF MAXSTG keyword to increase your storage.

                            Comment


                            • #15
                              Re: FTP problem

                              Originally posted by pramendra View Post
                              ... if you any matrial on ftp or IFS please let me know the link as well.
                              ...
                              Here is the link to resolve all of your problems:



                              and

                              Comment

                              Working...
                              X