IBM i Global

IBM i 

A space for professionals working with IBM’s integrated OS for Power systems to exchange ideas, ask questions, and share expertise on topics like RPG and COBOL development, application modernization, open source integration, system administration, and business continuity.


#Power


#IBMi
#Power
 View Only
Expand all | Collapse all

sftp from pc to savf

  • 1.  sftp from pc to savf

    Posted 25 days ago

    Hi, 

    Is there a way to get a pc file to a savf on the IBM i? I tried the ACS IFS drop then using the cpy command but that didn't work. I was also used to the straight FTP ->namefmt 1 ->  put /qsys.lib/mylib.lib/myfile.savf which was great but that doesn't seem to work on sftp. 



    ------------------------------
    Michael Cramer
    ------------------------------


  • 2.  RE: sftp from pc to savf

    Posted 25 days ago

    Assuming a savefile named mysavf.savf on your PC in the current directory:


    Create the (empty) save file first on the host:

    CRTSAVF MYLIBRARY/MYSAVF

    Then sftp to that destination:

    sftp mysavf.savf myprofile@mysystem.myorg.com:/QSYS.LIB/MYLIBRARY.LIB/MYSAVF.FILE



    ------------------------------
    Jack Woehr
    Senior Consultant
    Seiden Group LLC
    Beulah CO
    3038478442
    ------------------------------



  • 3.  RE: sftp from pc to savf

    Posted 25 days ago

    Hi Jack, 

    with what tool are you able to do that? 



    ------------------------------
    Michael Cramer
    ------------------------------



  • 4.  RE: sftp from pc to savf

    Posted 25 days ago

    @Michael Cramer maybe I misunderstood your question.

    thought you were asking how to move a savefile you had downloaded to your PC up to an IBM i.

    Now I see I may have misinterpreted your request.

    Can you tell me what you are actually trying to do in more detail?



    ------------------------------
    Jack Woehr
    Senior Consultant
    Seiden Group LLC
    Beulah CO
    3038478442
    ------------------------------



  • 5.  RE: sftp from pc to savf

    Posted 25 days ago

    The command you provided doesn't work so I was asking what sftp tool you are able to execute this command with successfully. 

    I'm using the built-in Windows 11 sftp cmd. 



    ------------------------------
    Michael Cramer
    ------------------------------



  • 6.  RE: sftp from pc to savf

    Posted 25 days ago
    Edited by Jack Woehr 25 days ago

    You're right, that was off the top of my head.

    Use SCP instead ... the sftp will work the other direction okay, but you can use scp either way.

    scp mysavf.savf myprofile@mysystem.myorg.com:/QSYS.LIB/MYLIBRARY.LIB/MYSAVF.FILE



    ------------------------------
    Jack Woehr
    Senior Consultant
    Seiden Group LLC
    Beulah CO
    3038478442
    ------------------------------



  • 7.  RE: sftp from pc to savf

    Posted 21 days ago

    that worked, thanks Jack. 



    ------------------------------
    Michael Cramer
    ------------------------------



  • 8.  RE: sftp from pc to savf

    Posted 24 days ago

    Hi Michael,

    As Jack for a single file transfer scp is probably the quickest route. If you are wanting to do multiple files then I use SFTP with a batch file, where the contents of the batch file using either get IBMi/filea local/filea. 

    sftp -b batchfile.txt -i sshkey user@host

    This works well if your having to repeat the process multiple times (maybe not save files or different LPARS as you can change the host/user info.

    In order to use the SFTP I downloaded openSSH / git to have the linux based commands like ssh etc.



    ------------------------------
    James Cole
    ------------------------------



  • 9.  RE: sftp from pc to savf

    Posted 24 days ago

    Jack,

    You haven't had to precreate the save file in, like, forever if you have an extension of .savf on the file on your PC.  Learn something new, boomer.  :-)

    AFAIK that's the only time you can use an attribute instead of the object type.



    ------------------------------
    Robert Berendt IBMChampion
    Business Systems Analyst, Lead
    Dekko
    Fort Wayne
    ------------------------------



  • 10.  RE: sftp from pc to savf

    Posted 24 days ago

    Esteemed Rob ...

    I think what you're saying is true with FTP but I'm not sure it works with scp ,, will have to try it.



    ------------------------------
    Jack Woehr
    Senior Consultant
    Seiden Group LLC
    Beulah CO
    3038478442
    ------------------------------



  • 11.  RE: sftp from pc to savf

    Posted 24 days ago

    Hello Michael
    You write that it does not work with iACS, but did you try to upload your PC file directly to a library in place of an IFS directory?

    For me, it works. You just have to display the content of your library with an IFS name format (i.e. /QSYS.LIB/YOURLIB.LIB), then upload (Actions/Upload) your file with a SAVF extension. It creates the save file and properly upload the content as a save file.

     



    ------------------------------
    Marc Rauzier
    ------------------------------



  • 12.  RE: sftp from pc to savf

    Posted 21 days ago

    Tried this but I get a format error. 



    ------------------------------
    Michael Cramer
    ------------------------------



  • 13.  RE: sftp from pc to savf

    Posted 21 days ago

    IBM save files have a specific format. Are you sure your PC file is in that format? For example, a save file has a record length of 528 bytes. There is header information about the save operation performed, and then detail information about the objects(s) saved, and file member names if applicable.






  • 14.  RE: sftp from pc to savf

    Posted 20 days ago

    Hi Michael, 

    I have not tried this yet however, this tutorial video shows how to use ACS https://www.youtube.com/watch?v=AFH0uW_klvA

    Hope it helps.



    ------------------------------
    James Cole
    ------------------------------



  • 15.  RE: sftp from pc to savf

    Posted 24 days ago

    Use ACS IFS tool to upload the PC file to the IFS. I usually use my home directory or /tmp. Create a save file in your preferred library. Then use CPYFRMSTMF to copy the PC file from your selected IFS directory to the SAVF in your library. 

    Scott



    ------------------------------
    Scott Schollenberger
    ------------------------------