When running from command line using corecmd.exe, I attempted to upload a file that didn't exist locally. The job returned successfully, the -log file showed it uploaded a file, and there was a success entry in the -output file.
Shouldn't this be setting a return code of 30 for file not found?
Thanks,
Gary
bad return code when uploading non-existent file
On an unrelated issue, the -log file has lines ending in CR CR LF. In notepad it looks fine, but in my nicer editor, every other line is blank.
This is the log of the file not being there.
[code]
09/09/11 15:32
Resolving x.com...
Connect socket #508 to x.x.x.x, port 20021...220 Welcome to x. Time = 15:33:00
AUTH TLS
234 AUTH TLS-C/TLS OK.
SSLv3, cipher TLSv1/SSLv3 (DES-CBC3-SHA) - 168 bitUSER x
331 Password required for x.
PASS **********
230 Connect:Enterprise UNIX login ok, access restrictions apply.
SYST
215 UNKNOWN Type: L8
PWD
257 "/x" is current directory.
CWD /x/
250 CWD command successful.
PBSZ 0
200 PBSZ 0 OK.
PROT P
200 PROT P OK, data channel will be secured.
PASV
227 Entering Passive Mode (x,x,x,x,82,8)
LIST
Connect socket #536 to x.x.x.x, port 21000...SSLv3, cipher TLSv1/SSLv3 (DES-CBC3-SHA) - 168 bit150 Opening ASCII mode data connection for .
226 Transfer complete.
CWD /x
250 CWD command successful.
PASV
227 Entering Passive Mode (x,x,x,x,82,9)
LIST
Connect socket #536 to x.x.x.x, port 21001...SSLv3, cipher TLSv1/SSLv3 (DES-CBC3-SHA) - 168 bit150 Opening ASCII mode data connection for .
226 Transfer complete.
CWD /x/
250 CWD command successful.
TYPE A
200 Type set to A.
QUIT
221 Goodbye.
sent 42, recd 42
Total uploaded files: 1
Total uploaded data: 253
Total downloaded files: 0
Total downloaded data: 0
[/code]
The log with the file present and uploading correctly is the same except for the additional lines after the line "200 Type set to A"
[code]
PASV
227 Entering Passive Mode (x,x,x,x,82,12)
STOR x
Connect socket #540 to x.x.x.x, port 21004...SSLv3, cipher TLSv1/SSLv3 (DES-CBC3-SHA) - 168 bit150 Opening ASCII mode data connection for x.
226- Transfer complete - acknowledgment message is pending.
226- Transfer complete - acknowledgment message is pending.
x - 1920 bytes transferred
226 Transfer complete (Batch Number = 22051).
QUIT
221 Goodbye.
sent 51, recd 51
Total uploaded files: 1
Total uploaded data: 1 KB
Total downloaded files: 0
Total downloaded data: 0
[/code]
This is the log of the file not being there.
[code]
09/09/11 15:32
Resolving x.com...
Connect socket #508 to x.x.x.x, port 20021...220 Welcome to x. Time = 15:33:00
AUTH TLS
234 AUTH TLS-C/TLS OK.
SSLv3, cipher TLSv1/SSLv3 (DES-CBC3-SHA) - 168 bitUSER x
331 Password required for x.
PASS **********
230 Connect:Enterprise UNIX login ok, access restrictions apply.
SYST
215 UNKNOWN Type: L8
PWD
257 "/x" is current directory.
CWD /x/
250 CWD command successful.
PBSZ 0
200 PBSZ 0 OK.
PROT P
200 PROT P OK, data channel will be secured.
PASV
227 Entering Passive Mode (x,x,x,x,82,8)
LIST
Connect socket #536 to x.x.x.x, port 21000...SSLv3, cipher TLSv1/SSLv3 (DES-CBC3-SHA) - 168 bit150 Opening ASCII mode data connection for .
226 Transfer complete.
CWD /x
250 CWD command successful.
PASV
227 Entering Passive Mode (x,x,x,x,82,9)
LIST
Connect socket #536 to x.x.x.x, port 21001...SSLv3, cipher TLSv1/SSLv3 (DES-CBC3-SHA) - 168 bit150 Opening ASCII mode data connection for .
226 Transfer complete.
CWD /x/
250 CWD command successful.
TYPE A
200 Type set to A.
QUIT
221 Goodbye.
sent 42, recd 42
Total uploaded files: 1
Total uploaded data: 253
Total downloaded files: 0
Total downloaded data: 0
[/code]
The log with the file present and uploading correctly is the same except for the additional lines after the line "200 Type set to A"
[code]
PASV
227 Entering Passive Mode (x,x,x,x,82,12)
STOR x
Connect socket #540 to x.x.x.x, port 21004...SSLv3, cipher TLSv1/SSLv3 (DES-CBC3-SHA) - 168 bit150 Opening ASCII mode data connection for x.
226- Transfer complete - acknowledgment message is pending.
226- Transfer complete - acknowledgment message is pending.
x - 1920 bytes transferred
226 Transfer complete (Batch Number = 22051).
QUIT
221 Goodbye.
sent 51, recd 51
Total uploaded files: 1
Total uploaded data: 1 KB
Total downloaded files: 0
Total downloaded data: 0
[/code]
-
- Site Admin
- Posts: 987
- Joined: Mon Mar 24, 2003 4:37 am
-
- Site Admin
- Posts: 987
- Joined: Mon Mar 24, 2003 4:37 am
That should work, although you may want to consider using fully qualified paths (ie: c:\upload\x)
I did not try using the -FN parameter in my test, I tried that in a new test and the %errorlevel% variable was 30 again.
You should see a "x - File not found" error in your log. Unless there was a directory named "x"?
I did not try using the -FN parameter in my test, I tried that in a new test and the %errorlevel% variable was 30 again.
You should see a "x - File not found" error in your log. Unless there was a directory named "x"?
When I posted my command, I had redacted it a little. I've left more in this time.
I did further testing and was able to get a return code 30 with
corecmd.exe -s -site Bank_Test -A -O -u Z:\BNK-Bank\Bank\upload\ACH.txt -FN x380.acfhxx.w700 -log logs/log_ACH.txt -output logs/output_ACH.txt
But, when I added the -p option, it then returned a 0
-p /ch172712
I did further testing and was able to get a return code 30 with
corecmd.exe -s -site Bank_Test -A -O -u Z:\BNK-Bank\Bank\upload\ACH.txt -FN x380.acfhxx.w700 -log logs/log_ACH.txt -output logs/output_ACH.txt
But, when I added the -p option, it then returned a 0
-p /ch172712
-
- Site Admin
- Posts: 987
- Joined: Mon Mar 24, 2003 4:37 am
Using "-p /ch172712/" still returns 0.
Using "-p /" returns 4.
In the log file it was attempting to 'CWD ' and threw an error
I tried -p // and it then did 'CWD /' and again returned a 0. For the rest of my testing I will use this option.
Finally I found something interesting. I was able to recreate this every time. Of course, I've been using the bank site (Unix). I then tried our z/OS mainframe ftp and same result of 0. I finally tried our IIS ftp server and received a 30 with the following in the log:
IIS with -p:
TYPE A
WARNING: Zero length file...200 Type set to A.
ACH.txt - File not found...
So, it appears receiving the 30 is dependent on the server that is being connected to?
After looking closer, I also noticed that the "200 Type set to A" was in a different location for several runs.
Unix without -p
TYPE A
200 Type set to A.
WARNING: Zero length file...ACHEAS.txt - File not found...
IIS without -p.
257 "/" is current directory.
WARNING: Zero length file...TYPE A
ACHEAS.txt - File not found...
200 Type set to A.
z/OS without -p
257 "'xxxx.'" is working directory.
WARNING: Zero length file...TYPE A
ACHEAS.txt - File not found...
200 Representation type is Ascii NonPrint
In the least it looks like the log is being written to by two different threads. Could it be an issue dependent on how quickly the server responds?
Let me know if there is any more info I can pass along or if there is anything else I can test.
Using "-p /" returns 4.
In the log file it was attempting to 'CWD ' and threw an error
I tried -p // and it then did 'CWD /' and again returned a 0. For the rest of my testing I will use this option.
Finally I found something interesting. I was able to recreate this every time. Of course, I've been using the bank site (Unix). I then tried our z/OS mainframe ftp and same result of 0. I finally tried our IIS ftp server and received a 30 with the following in the log:
IIS with -p:
TYPE A
WARNING: Zero length file...200 Type set to A.
ACH.txt - File not found...
So, it appears receiving the 30 is dependent on the server that is being connected to?
After looking closer, I also noticed that the "200 Type set to A" was in a different location for several runs.
Unix without -p
TYPE A
200 Type set to A.
WARNING: Zero length file...ACHEAS.txt - File not found...
IIS without -p.
257 "/" is current directory.
WARNING: Zero length file...TYPE A
ACHEAS.txt - File not found...
200 Type set to A.
z/OS without -p
257 "'xxxx.'" is working directory.
WARNING: Zero length file...TYPE A
ACHEAS.txt - File not found...
200 Representation type is Ascii NonPrint
In the least it looks like the log is being written to by two different threads. Could it be an issue dependent on how quickly the server responds?
Let me know if there is any more info I can pass along or if there is anything else I can test.
Sorry for the delayed response as I didn't get an email about your post.
I didn't realize server type was even an option. It is set to Auto, but when I tried to change it to Connect:Enterprise, it told me that it requires Core FTP Pro. I am only using the LE version, so I cannot check if that would make any difference.
I tried changing my z/OS setting to Unix and it then did give me the 30 as it should.
Setting the correct server type might solve the problem, but I still don't see why that would be necessary to check the existence of a local file.
I didn't realize server type was even an option. It is set to Auto, but when I tried to change it to Connect:Enterprise, it told me that it requires Core FTP Pro. I am only using the LE version, so I cannot check if that would make any difference.
I tried changing my z/OS setting to Unix and it then did give me the 30 as it should.
Setting the correct server type might solve the problem, but I still don't see why that would be necessary to check the existence of a local file.