ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SFTP Error Return Code

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

  • SFTP Error Return Code

    I am using generic program to drop and pick up files. It is not necessary that file should exist on remote server for pick up.
    But then it gives error - No such file or directory.
    My existing logic causes failure -

    MONSG(QSH0000) then(DO)
    SNDPGMMSG - Escape message
    End do

    I just need to skip this error if there are no remote files. Can someone advise on which and how exit status can be used to skip this message.

  • #2
    Re: SFTP Error Return Code

    Without seeing your script . . .

    SFTP allows to you ignore failed commands by prefixing them with a hyphen. Would that help you in this case?

    Comment


    • #3
      Re: SFTP Error Return Code

      Originally posted by TedHolt View Post
      Without seeing your script . . .

      SFTP allows to you ignore failed commands by prefixing them with a hyphen. Would that help you in this case?
      Script is simple
      get file_name*

      All I need is - it should pick up file when available and ignore if not on the server. But if it is not on the server, MONMSG(QSH000) traps error and fails the job as coded in CLP.

      Comment


      • #4
        Re: SFTP Error Return Code

        Ted gave you the answer '-get file_name*'. it will ignore any errors generated by the command.

        Chris...

        Comment


        • #5
          Re: SFTP Error Return Code

          Originally posted by chris_hird View Post
          Ted gave you the answer '-get file_name*'. it will ignore any errors generated by the command.

          Chris...
          Thanks I got it now. It worked, thanks for solution

          Comment


          • #6
            Re: SFTP Error Return Code

            Do you want to ignore all errors? Or do you only want to ignore the one specific "No such file..." error?
            Tom

            There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

            Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

            Comment

            Working...
            X