ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Zipping a file in IFS

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

  • Zipping a file in IFS

    Hi All,

    i have the below the command to copy data to IFS

    CPYTOIMPF FROMFILE(MYLIB/MYFILE) TOSTMF('Report/output.TXT')

    After copying to IFS i need to zip the file and send mail to users.

    For zipping have used this command

    QSH CMD('jar -cfm output.zip output.txt')

    But the command is not working and throwing error saying java.io.FileNotFoundException: output.txt

    The file is there in the mentioned folder still am getting the same.

    Kindly help me to solve this issue.

  • #2
    Re: Zipping a file in IFS

    Have you got an upper case file extension (output.TXT) but are specifying a lower case one (output.txt) ?

    Comment


    • #3
      Re: Zipping a file in IFS

      You specified a subdirectory ('Report') on the CPYTOIMPF, but did not specify a subdirectory on the jar command.

      Comment


      • #4
        Re: Zipping a file in IFS

        Originally posted by vijayrmca
        Hi All,

        i have the below the command to copy data to IFS

        CPYTOIMPF FROMFILE(MYLIB/MYFILE) TOSTMF('Report/output.TXT')

        After copying to IFS i need to zip the file and send mail to users.

        For zipping have used this command

        QSH CMD('jar -cfm output.zip output.txt')

        But the command is not working and throwing error saying java.io.FileNotFoundException: output.txt

        The file is there in the mentioned folder still am getting the same.

        Kindly help me to solve this issue.
        The syntax doesn't look correct. It should be:
        jar cfm <archive name> <stmf>

        However, do you need the manifest? I suspect you really want

        jar cfM <archive name> <stmf>

        A lower case m indicates a manifest should be included, a capital M specifies no manifest. For zip files, you should not be including that. You have also specified -c (which should be a capital) which indicates you are temporarily changing directory during the command.
        Also, as Scott has mentioned, unless you have changed directory beforehand, you're looking in the wrong place.

        Comment

        Working...
        X