ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Copy file to IFS

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

  • Copy file to IFS

    Hi all,

    I have a process where I:
    1. get a file to my PC
    2. manually copy it to IFS
    3. run CL program to upload to AS400.
    How can i automate #2 from PC to IFS? batch script/cl command/any other ideas?

    Thanks.

  • #2
    You can use FTP to transfer the File and the last Command in the FTP-Script starts a command on the AS400

    Comment


    • #3
      There are lots of questions about this process and the file etc because what you are doing seems a bit of a round-about way of doing things.
      First, are you really uploading it to an AS/400? Those systems haven't been sold in like 20 years or more (don't know the exact date) and the old OS it would be running would make your options more limited than today's systems. What OS version is this ancient system running? I'm not sure how much help people could give as I for one don't remember what older OS's were capable of doing.

      You say the first step is to get the file to your PC. Where is this file? Is it on a network that you grab? Do you download it from another server using some software that uses ODBC for instance? What format is the file in (e.g. a CSV or flat file)?
      The question here is why do you download it to your PC first? Can your system get it directly? If someone places the file on a network drive, can they place it on a netserver share? If you download it using some SQL, can your AS/400 do that directly?

      Next you copy it to the "IFS" on your AS/400 system (I dislike IFS because it encompasses all file systems, including the library file system) and then "upload" it to the AS/400. That doesn't makes sense as it's already there. I assume you mean you upload it to the "/Root" filesystem on your AS/400 and then copy it to a file in the library file system. Can you upload it to the file directly? All these options depend on the format of the file and where it came from.

      Comment


      • #4
        I prefer to use SSH for such tasks.
        In Windows you have SCP to copy files from/to remote systems:
        Code:
        scp your-local-file.txt andreas@your-ibm-i:/home/andreas/remote-dir
        By SSH you can also call remote commands:

        Code:
        ssh andreas@your-ibm-i 'cl "CALL LIB/YOURPGM"
        If you need to know how to configure SSH on your IBM i, I have written a short docu in my GitHub project:
        Example project using: VSCode, GIT and GNU Make. Contribute to andreas-prouza/ibm-i-build development by creating an account on GitHub.

        Comment

        Working...
        X