Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

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

Former Member
0 Likes
727

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.

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

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.

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

1 REPLY 1
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
605

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