Skip to Content
avatar image
Former Member

open dataset using filter 'ftp -v -n' does not react anyway

I want to transfer files to another server using the command 'OPEN DATASET'.

But if I try to execute that pipe command, the system does not write log for connection. Just create a 0byte file.

So I want to know how to check or how to test command 'open dataset using filter 'ftp -v -n' '.

Or do I have to check system configurations or something others?

Please give me a wise solution.

I attach my source code at below.

--------------------------------------------------

CONCATENATE 'open' g_host INTO open_rec SEPARATED BY space.
TRANSLATE open_rec TO LOWER CASE.

CONCATENATE 'user' g_user g_pwd INTO user_rec SEPARATED BY space.
TRANSLATE user_rec TO LOWER CASE.

pass_rec = 'cd /files/inbound'.
TRANSLATE pass_rec TO LOWER CASE.

CLEAR l_msg.
TRY.
OPEN DATASET comd FOR OUTPUT IN TEXT MODE
FILTER 'ftp -v -n'
ENCODING UTF-8
MESSAGE l_msg.
ENDTRY.

TRANSFER open_rec TO comd.
TRANSFER user_rec TO comd.
TRANSFER pass_rec TO comd.
TRANSFER put TO comd.
TRANSFER 'bye' TO comd.

WAIT UP TO 5 SECONDS.

TRY.
CLOSE DATASET comd.
CATCH cx_sy_file_close.
MESSAGE s000 WITH 'Fail to Close File' DISPLAY LIKE 'E'.
EXIT.
ENDTRY.

--------------------------------------------------

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 05, 2017 at 07:42 PM

    I don't think you can do FTP with OPEN DATASET if that's what you're trying to achieve...

    Add comment
    10|10000 characters needed characters exceeded