Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: FTP GET to run IBM host job

Revisiting this thread, I probably misunderstood the last post. The reason why the commands after the open command were not executed automatically is that there are spaces after the ^ sign.
See https://winscp.net/eng/docs/faq_batch_file#newline_escaping
martin

Re: FTP GET to run IBM host job

EDIT: This answer is wrong, see the next post.
WinSCP cannot do that.
Though, cannot you just send the GET 'X1.LTZ.FT.JCL($FX983C0)' command, the way you (probably) send the QUOTE SITE FILETYPE=JES?
nhf1ers

Re: Possible to submit JCL with winSCP?

I have tried to convert the ftp key word quote to use call in this script:
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="D:\DATA\log\SendJCL.log" /ini=nul ^
  /command ^
    "open ftpes://UID:PWD@my.mvs.com/" ^   
    "Call site filetype=jes" ^
    "put -transfer=Ascii d:\data\jcl\MyJOB.JCL" ^
    "exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
exit /b %WINSCP_RESULT%

It stops after the open statement with a WinSCP command prompt
I then paste the call command at the prompt:
winscp>Call site filetype=jes ^

then paste the put command at the prompt:
winscp>put -transfer=Ascii d:\data\jcl\JOB.JCL" ^

and the job is submitted successfully
Can not figure out why it is not processing the entire script automatically.
Any help is appreciated.
ijsbees

Hi Martin,

Thanks for your answer. What I meant was, if it's possible to put a (jcl) file on the JES queue on Z with WinSCP?

Regards,
Mike.
Ijsbees

Possible to submit JCL with winSCP?

Hi,

I used submit JCL with FTP (example below). Is there any way to do this with winSCP?

Thanks in advance.
Regards,
Mike.

FTP example:
ftp

open servername 
user
password
quote site filetype=jes 
mdel *.*   
put c:\jcl.txt
ls 
disconnect 
quit
Darvin2016

Not a good news, but thank you for your time
martin

Re: FTP GET to run IBM host job

It won't work. WinSCP will always try to determine if the "name" is a file or a directory.
Darvin2016

FTP GET to run IBM host job

Hello
I need help on an unusual task to perform using WinSCP .NET library (version 5.7.7).
This is how it looks like from Windows commandline FTP client:
...

ftp> QUOTE SITE FILETYPE=JES
200 SITE command was accepted
ftp> GET 'X1.LTZ.FT.JCL($FX983C0)'
200 Port request OK.
125-Submitting job 'X1.LTZ.FT.JCL($FX983C0)' FIXrecfm 80
125 Unable to send X1.LTZ.FT.JCL($FX983C0)
550 Transfer aborted
ftp>

In spite of the message "550 Trasfert aborted" it run some job on host and doesn't return any data.

I'm trying to move those commands on my new .NET exe based on WinSCP library.
It works fine until it has to execute:
TransferResult = mySessionBMP.GetFiles("'X1.LIZ.FT.JCL($FX983C0)'", ".\FTPUCBesito" & Now().ToString("yyyyMMddHHmmss") & ".txt", False, myTransferOption)

it fails with the error:
  <group name="get  -nopermissions -nopreservetime -transfer=&quot;ascii&quot; -- &quot;/'X1.LIZ.FT.JCL($FX983C0)'&quot; &quot;.\FTPUCBesito20160601114526.txt&quot;" start="2016-06-01T09:45:26.418Z">
    <failure>
      <message>Can't get attributes of file ''X1.LIZ.FT.JCL($FX983C0)''.</message>
      <message>File or folder ''X1.LIZ.FT.JCL($FX983C0)'' does not exist.</message>
    </failure>
  </group>


Ok, I'm aware the file doesn't exists, it's a sort of virtual file. Just I'm looking for a way to tell WinSCP to try to get it without any check on remote file.
Is it possible? Any other idea to get that job done?

Thanks